How to trap keystrokes in ListIcon gadget?

Just starting out? Need help? Post your questions and find answers here.
RobertSF
User
User
Posts: 61
Joined: Thu May 03, 2018 4:24 pm

How to trap keystrokes in ListIcon gadget?

Post 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.
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4749
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: How to trap keystrokes in ListIcon gadget?

Post by Fangbeast »

RobertSF wrote: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.
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
Amateur Radio, D-STAR/VK3HAF
bosker
Enthusiast
Enthusiast
Posts: 105
Joined: Fri Jan 08, 2010 11:04 pm
Location: Hampshire, UK

Re: How to trap keystrokes in ListIcon gadget?

Post by bosker »

@RobertSF
Are you using the demo version of PB?
User avatar
Shardik
Addict
Addict
Posts: 1989
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: How to trap keystrokes in ListIcon gadget?

Post 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.
RobertSF
User
User
Posts: 61
Joined: Thu May 03, 2018 4:24 pm

Re: How to trap keystrokes in ListIcon gadget?

Post by RobertSF »

Thank you, everyone.

Yes, I'm on the demo version, and Shardik's explanation makes sense.
Post Reply