Page 1 of 1
Getting a key identifier
Posted: Sun Jan 07, 2018 10:26 pm
by CharlesT
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.
Re: Getting a key identifier
Posted: Tue Jan 09, 2018 6:22 am
by netmaestro
Depends, are you working with sprites and screens or on the OS gui? If so, what OS?
Re: Getting a key identifier
Posted: Tue Jan 09, 2018 8:20 pm
by CharlesT
netmaestro wrote:Depends, are you working with sprites and screens or on the OS gui? If so, what OS?
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.
Thanks.
Re: Getting a key identifier
Posted: Wed Jan 10, 2018 10:13 am
by #NULL
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.