FME_KEYDOWN

Description

FME_KEYDOWN event is triggered when the user presses a keyboard button.
The n value of the events contains the VK code of the pressed key.
To activate the FME_KEYDOWN event you need use "Dialog: keyevents" or setDialogEvent(4) in your code.
If you want to check for mouse buttons, Shift, Ctrl, Alt etc. you need to use getAsyncKeyState() or getAsyncKeyStateF().
This event is only triggered once per keypress; it is not triggered again if you hold the key.

Example

%ffp
Dialog: keyevents

OnCtl(n): {
    if (e == FME_KEYDOWN) {
         Info("You just pressed key %d", n);
    }
    return false;
}

Also see

FME_KEYUP, getAsyncKeyState, getAsyncKeyStateF, setDialogEvent, VK codes

Comments

Everyone can add his comments about his experiences with this event here. Tips for using it are welcome, too.