08-21-2014 02:21 AM
hello,
I have a foot pedal that is acting as a keyboard key or a mouse button. I use it to open and close a shutter.
I was wondering if there is a way to program it to act as a latch button?
for example, if my foot pedal is the same as pressing 'K', I want to write a 'K' when my foot is on the pedal and another 'K' when my foot is off the pedal.
currently, for two 'K' i need to step on it twice.
Avishay
08-21-2014 02:41 AM
You can get this effect by using an event structure. Notice the one event that has "Key Down" and "Key Up" events. It adds a K to the string every time any key is pressed or released. You probably need to make a control sequence that identifies your foot pedal here, but it is a nudge in the right direction I think?
08-21-2014 03:07 AM
@JarleEkanger wrote:
You can get this effect by using an event structure. Notice the one event that has "Key Down" and "Key Up" events. It adds a K to the string every time any key is pressed or released. You probably need to make a control sequence that identifies your foot pedal here, but it is a nudge in the right direction I think?
Can you post your code in 2013 or may be attach a snippet?
08-21-2014 03:13 AM
08-21-2014 02:00 PM - edited 08-21-2014 02:01 PM
What kind of data are you getting from the pedal? Can you create a user event for this data and compare the new value to the previous value? If they are the same, pedal hasn't been pressed. If they are different pedal has been pressed....you just have to determine which way the pedal moved.
Edit: actually you don't care which way the pedal moved because you want a 'k' everytime.