-
-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onClick triggers on mouse release, not on press #38
Comments
I was actually thinking of removing that property altogether with in the meantime this how you can achieve this const { Gdk } = imports.gi;
const button = {
type: 'button',
// 'button-release-event' for the release event
connections: [['button-press-event', (widget, event) => {
const button = event.get_button()[1]; // event is a Gdk.Event
if (button === Gdk.BUTTON_SECONDARY)
print('right click'); // assuming right handed mouse
if (button === Gdk.BUTTON_MIDDLE)
print('middle click');
if (button === Gdk.BUTTON_PRIMARY)
print('left click');
}]],
}; |
Aylur
added a commit
that referenced
this issue
Aug 11, 2023
that worked, thanks |
I have implemented your suggestion for button and eventbox, also updated the wiki |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
onClick
runs when the mouse button is released, not pressedonClick
for mouse press andonClickRelease
for release?The text was updated successfully, but these errors were encountered: