Re: using keys in windows

new topic     » goto parent     » topic index » view thread      » older message » newer message

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.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu