Restored from previous forum. Originally posted by Fangbeast.
Does anyone remember/know what API commands to use to check for pressing an up or down arrow?
I'd rather not use the PB keyboard function because that requires an up-to-date DirectX installed and a lot of people who test my programs do not have that and of course it crashes.
/me falls out of the chair asleep. (IRC talk)
Thanks to anyone who remembers:)
Fangles
API for checking up and down arrow?
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> Does anyone remember/know what API commands to use to check for pressing an up or down arrow?
PB - Registered PureBasic Coder
Edited by - PB on 11 June 2002 01:55:17
> Does anyone remember/know what API commands to use to check for pressing an up or down arrow?
Code: Select all
GetAsyncKeyState_(#VK_UP) ; Clear up key buffer.
GetAsyncKeyState_(#VK_DOWN) ; Clear down key buffer.
;
; And to check their state during runtime:
If GetAsyncKeyState_(#VK_UP)=-32767 ; Up arrow pressed.
If GetAsyncKeyState_(#VK_DOWN)=-32767 ; Down arrow pressed.
PB - Registered PureBasic Coder
Edited by - PB on 11 June 2002 01:55:17
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Fangbeast.
B. I don't know the syntax to check it.
I need to generate an up and down arrow event in a ListIconGadget so that I can go to some code. Where do I put that above code, how do I check it??
Fangles
A. I don't know where to put it (no example).Why not using AddKeyboardShortcut(Window, #PB_Shortcut_Up) ?
Fred - AlphaSND
B. I don't know the syntax to check it.
I need to generate an up and down arrow event in a ListIconGadget so that I can go to some code. Where do I put that above code, how do I check it??
Fangles
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Fangbeast.
Fangles
Thanks PB, but I get "Constant not found" for those two.> Does anyone remember/know what API commands to use to check for pressing an up or down arrow?
Code: Select all
GetAsyncKeyState_(#VK_UPARROW) ; Clear up key buffer. GetAsyncKeyState_(#VK_DOWNARROW) ; Clear down key buffer. ; ; And to check their state during runtime: If GetAsyncKeyState_(#VK_UPARROW)=-32767 ; Up arrow pressed. If GetAsyncKeyState_(#VK_DOWNARROW)=-32767 ; Down arrow pressed.
PB - Registered PureBasic Coder
Fangles
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> Thanks PB, but I get "Constant not found" for those two.
Sorry, they're meant to be #VK_UP and #VK_DOWN (I typed them from memory and
while half-asleep). I've fixed my example above to reflect this. BTW, all
these constants are found in the Win32API.doc file, if you have it. If not,
it's here (143k): http://www.mvps.org/vb/code/Win32api.zip
PB - Registered PureBasic Coder
> Thanks PB, but I get "Constant not found" for those two.
Sorry, they're meant to be #VK_UP and #VK_DOWN (I typed them from memory and
while half-asleep). I've fixed my example above to reflect this. BTW, all
these constants are found in the Win32API.doc file, if you have it. If not,
it's here (143k): http://www.mvps.org/vb/code/Win32api.zip
PB - Registered PureBasic Coder
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Fangbeast.
:)
Fangles
Thanks PB, works like a duck's bottom in water> Thanks PB, but I get "Constant not found" for those two.
Sorry, they're meant to be #VK_UP and #VK_DOWN (I typed them from memory and
while half-asleep). I've fixed my example above to reflect this. BTW, all
these constants are found in the Win32API.doc file, if you have it. If not,
it's here (143k): http://www.mvps.org/vb/code/Win32api.zip
PB - Registered PureBasic Coder
Fangles