Is there anyway to make the fragpedal II press a keyboard key in quick succession like a turbo function in game-pad (not hold down the key).
to be more precise, I need my button 1 to continuously press 'Z' key when i'm holding down the button. It shld only stop pressing the 'Z' key when i release button 1.
This post was last modified: 11-05-2008 02:17 AM by opelfrost.
There are a few different ways, but the best way is to use KeyPress(0, 'z', 20).
Below is the contents of the attached macro.
I added comments to help you understand what the code is doing.
THREAD Profile
Start:
WaitForButton(Button, ButtonMask) //This is to tell the program to wait for the button to be pressed.
DO //This start of the loop. The code below will be what is looped.
KeyPress(0, 'z', 20) //This is a key press of 'z'.
//The 20 represents the duration in milliseconds that
//the key will be held down. The lower the number the faster the key
//will be pressed. But if it is to short the computer might not
// catch that the key.
WHILE ((GetButtonState & ButtonMask) == Button) //This is the end loop. It stops
//when the button is lifted.
Thanks, managed to get it working, but when i tried to increase the miliseconds to 1000, the device decided to 'hang' when saving and after that, my computer juz refuse to detect the device -.-
when i tried to increase the milliseconds to 1000, the device decided to 'hang'
By increasing to 1000 means that it would hold the 'z' key down for 1000 milliseconds before releasing it. For what you are trying to do you want a lower number.