Drag-lock for trackballs #916
dr-diem
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use the top-left button on my Kensington Slimblade trackball to 'pick up' items - move them without having to hold down a button. This means the button needs to implement a toggle - remember its last position and send the appropriate button up or button down event. This macro achieves that aim:
if_eq($a, 0, key_down(BTN_LEFT).set(a,1),key_up(BTN_LEFT).set(a,0))
It defines a variable 'a' to keep state. If a==0 then send the 'left button down' event and set a=1. If a==1 then send the 'left button up' event and set a=0.
I think this would be a good candidate to add to examples.md. Apologies for being too lazy to clone and submit a PR :)
Beta Was this translation helpful? Give feedback.
All reactions