1. using keys in windows
- Posted by Frank Collins <Smoky1930 at AOL.COM> Aug 12, 2000
- 507 views
- Last edited Aug 13, 2000
Does anyone know how to use the arrow keys with win32lib I've tried onKeyPress, and onKeyDown but can't get it to work any suggestions would be great help.
2. Re: using keys in windows
- Posted by wolfgang fritz <wolfritz at king.igs.net> Aug 13, 2000
- 494 views
procedure do_arrow_key( integer key, integer shift ) if key = VK_LEFT then --do whatever... if key = VK_UP then -- do whatever else... if key = VK_RIGHT then -- do this... if key = VK_DOWN then -- do the last... onKeyDown[ control_with_focus ] = routine_id("do_arrow_key") > Does anyone know how to use the arrow keys with win32lib > I've tried onKeyPress, and onKeyDown but can't get it to work > any suggestions would be great help.
3. Re: using keys in windows
- Posted by David Cuny <dcuny at LANSET.COM> Aug 12, 2000
- 490 views
- Last edited Aug 13, 2000
Frank Collins wrote: > Does anyone know how to use the arrow keys with win32lib > I've tried onKeyPress, and onKeyDown but can't get it to work onKeyPress will only return "visible" keys; you need to use onKeyDown. Windows maps the keys a bit differently than DOS; take a look at the VK_ (virtual key) constants: VK_UP, VK_DOWN, VK_LEFT, etc. -- David Cuny
4. Re: using keys in windows
- Posted by Dan B Moyer <DANMOYER at PRODIGY.NET> Aug 13, 2000
- 496 views
Frank, Here's a demonstration of how to use the arrow keys in Win32Lib: <tested code follows> -- demonstrates using the arrow keys include Win32Lib.ew without warning constant MainWin = create(Window,"Press Arrow Keys",0,0,0,400,400,0) -------------------------------------------------------------------- procedure MainWin_onKeyDown ( int scanCode, int shift ) -- ** FOR AN ARROW KEY PRESSED: -- UP ARROW if scanCode = VK_UP then repaintWindow(MainWin) wPuts(MainWin,"up arrow") -- DOWN ARROW elsif scanCode = VK_DOWN then repaintWindow(MainWin) wPuts(MainWin,"down arrow") -- LEFT ARROW elsif scanCode = VK_LEFT then repaintWindow(MainWin) wPuts(MainWin,"left arrow") -- RIGHT ARROW elsif scanCode = VK_RIGHT then repaintWindow(MainWin) wPuts(MainWin,"right arrow") end if end procedure ------------------------------------------------------------ onKeyDown[MainWin] = routine_id("MainWin_onKeyDown") ----------------------------------------------------------- WinMain( MainWin, Normal ) ---------------------------------------------------------------------------- ----------- <end code> ----- Original Message ----- From: "Frank Collins" <Smoky1930 at AOL.COM> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Saturday, August 12, 2000 6:00 PM Subject: using keys in windows > Does anyone know how to use the arrow keys with win32lib > I've tried onKeyPress, and onKeyDown but can't get it to work > any suggestions would be great help.
5. Re: using keys in windows
- Posted by David Alan Gay <moggie at INTERLOG.COM> Aug 13, 2000
- 500 views
How about just using the regular key monitoring functions like get_key()? ----- Original Message ----- From: "Frank Collins" <Smoky1930 at AOL.COM> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Saturday, August 12, 2000 9:00 PM Subject: using keys in windows > Does anyone know how to use the arrow keys with win32lib > I've tried onKeyPress, and onKeyDown but can't get it to work > any suggestions would be great help. >
6. Re: using keys in windows
- Posted by Frank Collins <Smoky1930 at AOL.COM> Aug 13, 2000
- 503 views
Thanks for everyone's help it works now.