missing constant for key "-"

Just starting out? Need help? Post your questions and find answers here.
HarryT
New User
New User
Posts: 9
Joined: Fri Jul 05, 2013 9:56 pm
Location: Southern Germany

missing constant for key "-"

Post by HarryT »

I am trying to intercept the - key (minus) with the AddKeyboardShortcut() function.
But I can't find the #PB constant for this key. Is there none or was it just forgotten in the documentation?
#PB_Shortcut_Subtract works only for the numeric Keypad.

Any hints ?

Thanks,
Harry
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: missing constant for key "-"

Post by netmaestro »

#VK_OEM_MINUS is working here for the other one, on Windows at least.
BERESHEIT
HarryT
New User
New User
Posts: 9
Joined: Fri Jul 05, 2013 9:56 pm
Location: Southern Germany

Re: missing constant for key "-"

Post by HarryT »

netmaestro wrote:#VK_OEM_MINUS is working here for the other one, on Windows at least.
Thank you, netmaestro. It works.
BorisTheOld
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Apr 24, 2012 5:08 pm
Location: Ontario, Canada

Re: missing constant for key "-"

Post by BorisTheOld »

The best solution is to set up a small program to trap KeyUp events, and test each key in turn. You'll need to do this for each operating system that you use, as the key codes are sometimes different.

Some keys will give different values, depending on the OS and the state of the caps lock and shift key.

(Ooops! our power just went out, so I hope the microwave tower 10km away still has power. Our UPS system is keeping our own network and modem running, but we may have lost contact with the outside world.)
For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
Post Reply