Functions | |
void | SmartWin::AspectKeyPressed::onKeyPressed (typename MessageMapType::itsBoolFunctionTakingInt eventHandler) |
Setting the event handler for the "key pressed" event. |
void onKeyPressed | ( | typename MessageMapType::itsBoolFunctionTakingInt | eventHandler | ) | [inherited] |
Setting the event handler for the "key pressed" event.
If supplied event handler is called when control has the focus and a key is being pressed (before it is released)
parameter passed is int which is the virtual-key code of the nonsystem key being pressed. Return value must be of type bool, if event handler returns true event is defined as "handled" meaning the system will not try itself to handle the event.
Certain widgets, such as WidgetTextBox, will not report VK_RETURN unless you include ES_WANTRETURN in the style field of of the creational structure passed when you createTextBox( cs ).
Use virtualKeyToChar to transform virtual key code to a char, though this will obviously not work for e.g. arrow keys etc...