Programming Guide | WideStudio Index Table of contents |
How to select the key events on the input field
You can select or reject/convert the key events on the input field with the event procedure by the WSEV_KEY_HOOK trigger.// A WSEV_KEY_HOOK sample procedure. // Set the input field with the WSEV_KEY_HOOK trigger. ... public class hookop { protected static void hookop(WSCbase object){ // get the pressed key code. long key = Mwt.WSGIappKeyboard().getKey(); if ((key >= Mwt.WSK_0 && key <= Mwt.WSK_9 ) || (key >= Mwt.WSK_KP_0 && key <= Mwt.WSK_KP_9) || key == Mwt.WSK_plus || key == Mwt.WSK_minus || key == Mwt.WSK_BackSpace || key == Mwt.WSK_Delete || key == Mwt.WSK_Insert || key == Mwt.WSK_space || key == Mwt.WSK_Up || key == Mwt.WSK_Down || key == Mwt.WSK_Left || key == Mwt.WSK_Right || key == Mwt.WSK_Return ){ // dispatches.. return; } // Reject the other. Mwt.WSGIappKeyboard().setKey(0); } }This sample of the input field shows how to choose the key event. Mwt.WSGIappKeyboard().setKey(0) reject the key event which you do not need.
Copyright(C) WideStudio Development Team, 1999-2005 | Last modified: Jan 05, 2005 |