Re: Key Trapping in win32lib
- Posted by David Cuny <dcuny at LANSET.COM> Feb 27, 2000
- 454 views
J Reeves wrote: > I assume the onKeyPress is a key is held down?? Yes, and onKeyRelease is the release of a key. > Doing this in dos was faster, Once you figured out how.... Everyone's a critic. Actually, the onKeyPress and onKeyRelease are very much like getting raw information in DOS - they return the scan code. The project I'm currently writing unifies the two like this: procedure OnKeyPress( integer key, integer mask ) Key( key, mask, True ) end procedure onKeyPress[Win] = routine_id("OnKeyPress") procedure OnKeyDown( integer key, integer mask ) Key( key, mask, False ) end procedure onKeyDown[Win] = routine_id("OnKeyDown") The key processing code looks something like: procedure Key( integer key, integer mask, integer raw ) if key = 'a' and not raw then -- trapping a character elsif key = VK_PRIOR and raw then -- handle page up end if end procedure Hope this helps! -- David Cuny