Re: Win32Lib: Keypress Issue
- Posted by Derek Parnell <ddparnell at bigpond.com> Aug 06, 2004
- 368 views
cklester wrote: > > Derek Parnell wrote: > > > > procedure win_FullScreen_onKeyPress (integer self, integer event, sequence > > > params)--params > > > is ( int keyCode, int shift ) > > > if params[1] = VK_ESCAPE and fullScreenView then > > > fullScreenView = w32False > > > closeWindow( win_FullScreen ) > > > end if > > > end procedure > > > setHandler( Screen, w32HKeyPress, routine_id("win_FullScreen_onKeyPress")) > > Derek, I was using showWindow() instead of openWindow(). Why does > that make a difference? It doesn't, for this exercise. See example code below. > A menu click was setting fullScreenView to w32True, then > triggered showWindow() for the fullScreenView. Is that why > the Screen wasn't receiving my ESC press? Are you sure the menu click is actually firing?
without warning include win32lib.ew integer fullScreenView fullScreenView = w32False constant mw = create(Window, "Main", 0, 0, 0, 100, 100, 0) constant win_FullScreen = create(Window, "FULL", 0, 200, 200, 400, 400, 0) procedure win_FullScreen_onKeyPress (integer self, integer event, sequence params) if params[1] = VK_ESCAPE then fullScreenView = (not fullScreenView) showWindow( win_FullScreen, fullScreenView ) end if end procedure setHandler( Screen, w32HKeyPress, routine_id("win_FullScreen_onKeyPress")) WinMain(mw, Normal)
-- Derek Parnell Melbourne, Australia