Page 1 of 1
How to trap keystrokes in ListIcon gadget?
Posted: Mon May 21, 2018 3:49 am
by RobertSF
Basically the same question as
http://www.purebasic.fr/english/viewtopic.php?t=29918
but I'm sorry, the answer doesn't compile. PB doesn't know what #WM_KEYDOWN means.
Re: How to trap keystrokes in ListIcon gadget?
Posted: Mon May 21, 2018 4:09 am
by Fangbeast
Robert, you must be running an older version of PB in which that constant is not defined. Mine is v5.62 and the value #WM_KEYDOWN = 256 according to the compiler so put that at the top of your code somewhere and PB will then understand it.
#WM_KEYDOWN = 256 : at the very top of your code
Re: How to trap keystrokes in ListIcon gadget?
Posted: Mon May 21, 2018 10:41 am
by bosker
@RobertSF
Are you using the demo version of PB?
Re: How to trap keystrokes in ListIcon gadget?
Posted: Mon May 21, 2018 10:45 am
by Shardik
#WM_KEYDOWN and #VK_DELETE are constants defined in the
Windows API (
Application
Programming
Interface) or more specific Win32 API and are predefined only in PureBasic for Windows. EventwParam() is a deprecated PureBasic function only available in PureBasic for Windows.
So in order to help you we have to know on which OS (Linux, MacOS or Windows) you are currently doing your tests with PB. The demo versions don't support API functions so the demo version of Windows won't work with examples containing API functions.
Re: How to trap keystrokes in ListIcon gadget?
Posted: Mon May 21, 2018 1:36 pm
by RobertSF
Thank you, everyone.
Yes, I'm on the demo version, and Shardik's explanation makes sense.