Page 1 of 1
Finding a Key Already in Use
Posted: 11 Mar 2018, 03:01
by Rwelk137
Just a quick question question. When I'm configuring keys with my mini-keyboard, most of the keys not in use get shut off and the code returns the whatever key I'm trying to type with in the little window beneath the code as per the line
Code: Select all
else print('Not yet assigned: ' .. button)
But what if a button is already in use? Is there a way I check the value of a button that's already being used for something so I can map it to something else?
Re: Finding a Key Already in Use
Posted: 11 Mar 2018, 03:07
by Rwelk137
For reference, I'm trying to remap the arrow keys with the code
Code: Select all
elseif (button == 188) then
lmc_send_input(37, 0, 0) -- press LEFT ARROW
lmc_send_input(37, 0, 1) -- release LEFT ARROW
elseif (button == 46) then
lmc_send_input(39, 0, 0) -- press RIGHT ARROW
lmc_send_input(39, 0, 1) -- release RIGHT ARROW
A bug that I'm noticing is that when I press the keys, the cursor moves left or right two spaces rather than one. Any help with that would also be appreciated.
Re: Finding a Key Already in Use
Posted: 12 Mar 2018, 09:35
by admin
Rwelk137 wrote: ↑11 Mar 2018, 03:01
But what if a button is already in use? Is there a way I check the value of a button that's already being used for something so I can map it to something else?
You can put the print command at beginning of the callback handler, not to the last else, can't you?