11-16-2024, 04:33 PM
(This post was last modified: 11-16-2024, 04:34 PM by AutoStarter.)
I want to distinguish inside an TBItem event if left or right mouse was pressed and furthermore if modifier keys were used for that trigger as following but it seems not to work.
- RightClick open up a context menu for the item (probably internal menu with edit itemand find file option).
- MiddleClick is ignored (maybe problem of Windows 10 since design change)
- Win and Alt key modifier close menu and cant be used
- Key modifier access seems to work well
void ToolbarExample(TriggerArgs ta = null) {
var t = new toolbar();
t["LeftorRightClick"] = o => {
if (mouse.isPressed(MButtons.Left)) print.it("MouseLeft");
if (mouse.isPressed(MButtons.Right)) print.it("MouseRight");
if (keys.isPressed(KKey.Shift)) print.it("Shift");
if (keys.isPressed(KKey.Ctrl)) print.it("Ctrl");
if (keys.isPressed(KKey.Alt)) print.it("Alt");
if (keys.isPressed(KKey.Win)) print.it("Win");
};
t.Show(ta);
}
1. What shall I do to use other mouseclicks than left too?
2. Can I distinuish double and single click the same way by using the Click event of TBItem to implement the logic there, as I have it done already for trayIcon?
- RightClick open up a context menu for the item (probably internal menu with edit itemand find file option).
- MiddleClick is ignored (maybe problem of Windows 10 since design change)
- Win and Alt key modifier close menu and cant be used
- Key modifier access seems to work well
void ToolbarExample(TriggerArgs ta = null) {
var t = new toolbar();
t["LeftorRightClick"] = o => {
if (mouse.isPressed(MButtons.Left)) print.it("MouseLeft");
if (mouse.isPressed(MButtons.Right)) print.it("MouseRight");
if (keys.isPressed(KKey.Shift)) print.it("Shift");
if (keys.isPressed(KKey.Ctrl)) print.it("Ctrl");
if (keys.isPressed(KKey.Alt)) print.it("Alt");
if (keys.isPressed(KKey.Win)) print.it("Win");
};
t.Show(ta);
}
1. What shall I do to use other mouseclicks than left too?
2. Can I distinuish double and single click the same way by using the Click event of TBItem to implement the logic there, as I have it done already for trayIcon?