Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Nymphodora), 972 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Check if TAB is activated? #468913
10/27/17 10:39
10/27/17 10:39
Joined: Sep 2005
Posts: 352
Germany
preacherX Offline OP
Senior Member
preacherX  Offline OP
Senior Member

Joined: Sep 2005
Posts: 352
Germany
Is there a way to check if TAB is activated?
Do you have an example?

Last edited by preacherX; 10/27/17 23:12.
Re: Check if TAB is activated? [Re: preacherX] #468917
10/27/17 13:23
10/27/17 13:23
Joined: Jun 2009
Posts: 8
ChongQing,China
J
jockerob Offline
Newbie
jockerob  Offline
Newbie
J

Joined: Jun 2009
Posts: 8
ChongQing,China
the online manual gives a engine function named "key_pressed" that may help.
the TAB sancode is 15.

key_pressed (var number);
Checks whether a certain the key or button with the scancode given by number (see key mapping ) is pressed.

Re: Check if TAB is activated? [Re: jockerob] #468918
10/27/17 13:41
10/27/17 13:41
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
key_tab anyone confused


POTATO-MAN saves the day! - Random
Re: Check if TAB is activated? [Re: Kartoffel] #468924
10/27/17 20:33
10/27/17 20:33
Joined: Jul 2014
Posts: 72
D
DriftWood Offline
Junior Member
DriftWood  Offline
Junior Member
D

Joined: Jul 2014
Posts: 72
^--- Thank you, clear as day. However, if you want to wrap KEY_TAB + key_lastpressed(key released) you can use a function from keys.c.

Quote:
key_hit (var number)
Returns nonzero when the key with the given scan code (1..256, see key mapping) was pressed since the last key_hit call. It can be used in a while()..wait() loop to detect the moment when the key was pressed down.
key_hit (STRING* keystr)
Returns nonzero when the key belonging to given character string (f.i. "a", "f1", "esc" - see key mapping) was pressed since the last key_hit call. It can be used in a while()..wait() loop to detect the moment when the key was pressed down. A usage example can be found in the camera.c code.

http://www.conitec.net/beta/keys_c.htm
key_hit(-x-) followed by not !key_hit(-x-) in a while/if

Re: Check if TAB is activated? [Re: DriftWood] #468928
10/27/17 23:18
10/27/17 23:18
Joined: Sep 2005
Posts: 352
Germany
preacherX Offline OP
Senior Member
preacherX  Offline OP
Senior Member

Joined: Sep 2005
Posts: 352
Germany
I don't want to check if the key was pressed.

I want to check if the TAB function of the keyboard is activated (this could also happened before the engine starts and so key_hit would not detect it).

When it is ON, you don't have to press Shift to write capital letters.

In my game the user have to write small letters but when TAB is activated this will not work. So I want to tell the player that he should deactivate it but I don't know how to check if it is ON.

Re: Check if TAB is activated? [Re: preacherX] #468934
10/28/17 06:31
10/28/17 06:31
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Apparently you mean the Caps Lock key, not the Tab key.
Click here and subsequent links: https://stackoverflow.com/questions/13905342/winapi-how-to-get-the-caps-lock-state


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Check if TAB is activated? [Re: Superku] #468936
10/28/17 08:52
10/28/17 08:52
Joined: Sep 2005
Posts: 352
Germany
preacherX Offline OP
Senior Member
preacherX  Offline OP
Senior Member

Joined: Sep 2005
Posts: 352
Germany
Ups, yes, you're right! My fault! crazy Thanks for the link!


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1