Hi, all.
Is there a way to read into a variable the identifier of a key that has been pressed?
For example, the value of the constant #PB_Key_Up is 200. Is it possible to return that value when the key is pressed?
Thank you for your time.
Getting a key identifier
- netmaestro
- PureBasic Bullfrog
- Posts: 8452
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Getting a key identifier
Depends, are you working with sprites and screens or on the OS gui? If so, what OS?
BERESHEIT
Re: Getting a key identifier
Hi, netmaestro. I'm working with sprites and screens. To explain further: I would like to store, in a variable, the key constant value of the key that is pressed by the user. One way to do this would be to use a series of If statements or Select statements, checking for every possible key constant. But I wondered if there was a simple way of finding out the key constant value of whatever key was just pressed.netmaestro wrote:Depends, are you working with sprites and screens or on the OS gui? If so, what OS?
Thanks.
Re: Getting a key identifier
Multiple keys can be pressed at the same time, thats why there is no such functionality. You need to know what key you are looking for.