![]() |
Programming Guide |
WideStudio Index Table of contents |
Como selecionar eventos chaves no campo de entrada
Pode-se selecionar ou rejeitar/converter os eventos chave no campo de entrada com o procedimento de evento através de WSEV_KEY_HOOK trigger..
//A WSEV_KEY_HOOK sample procedure.Este exemplo de campo de entrada apresenta como escolher um evento chave.
//Set the input field with the WSEV_KEY_HOOK trigger.
#include "WSDkeyboard.h"
...
void hookop(WSCbase* object){
//get the pressed key code.
long key = WSGIappKeyboard()->getKey();
//Choose the key which is a numerical code.
if ( (key >= WSK_0 && key <= WSK_9 ) ||
(key >= WSK_KP_0 && key <= WSK_KP_9) ||
key == WSK_plus || key == WSK_minus ||
key == WSK_BackSpace || key == WSK_Delete || key == WSK_Insert ||
key == WSK_space || key == WSK_Up || key == WSK_Down ||
key == WSK_Left || key == WSK_Right || key == WSK_Return ){
//dispatches..
return;
}
//Reject the other.
WSGIappKeyboard()->setKey(0);
}
WSGIappKeyboard()->setKey(0) rejeita o evento chave desnecessário.
Copyright(C) WideStudio Development Team, 1999-2005 | Last modified: Jan 05, 2005 |