Gamestudio Links
Zorro Links
Newest Posts
Can't go to FALSEGOTO:DOUBLE?
by Turrican
Today at 00:34
Chamferbox Lucky Pack, once a year chance, 90% OFF limited deals
by Chamferbox
Yesterday at 21:10
How detect 200 bars after trade was opened?
by Tuguldur717
Yesterday at 13:58
Data quality and accuracy of test results
by brax
Yesterday at 13:44
Can be changed the header in Zorro?
by tomaslolo
Yesterday at 12:12
Price difference between last tick and previous.
by JRA
Yesterday at 11:47
Zorro on Linux
by alb
02/21/18 20:47
AUM Magazine
Latest Screens
Forgotten Tales - Demo version
RPG PARTY
Triton Wing now available on Steam
AckCon'17: Lotter vs The World
Who's Online
17 registered (dmac, Hredot, Cheulmen, BlackJack, MatPed, Kartoffel, alibaba, AndrewAMD, 3 invisible), 475 Guests and 8 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
tomaslolo, dmac, alb, may, piddle61
17896 Registered Users
Topic Options
Rate This Topic
#468913 - 10/27/17 12:39 Check if TAB is activated?
preacherX Offline
Senior Member

Registered: 09/09/05
Posts: 339
Loc: Germany
Is there a way to check if TAB is activated?
Do you have an example?


Edited by preacherX (10/28/17 01:12)

Top
#468917 - 10/27/17 15:23 Re: Check if TAB is activated? [Re: preacherX]
jockerob Offline
Newbie

Registered: 06/23/09
Posts: 8
Loc: 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.

Top
#468918 - 10/27/17 15:41 Re: Check if TAB is activated? [Re: jockerob]
Kartoffel Online
Expert

Registered: 06/11/09
Posts: 2146
Loc: Bavaria, Germany
key_tab anyone confused
_________________________
POTATO-MAN saves the day! - Random

Top
#468924 - 10/27/17 22:33 Re: Check if TAB is activated? [Re: Kartoffel]
DriftWood Offline
Junior Member

Registered: 07/03/14
Posts: 66
^--- 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

Top
#468928 - 10/28/17 01:18 Re: Check if TAB is activated? [Re: DriftWood]
preacherX Offline
Senior Member

Registered: 09/09/05
Posts: 339
Loc: 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.

Top
#468934 - 10/28/17 08:31 Re: Check if TAB is activated? [Re: preacherX]
Superku Offline
Senior Expert

Registered: 09/13/03
Posts: 6635
Loc: 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

Superku The Game

Severely outdated footage: http://store.steampowered.com/app/407570

Top
#468936 - 10/28/17 10:52 Re: Check if TAB is activated? [Re: Superku]
preacherX Offline
Senior Member

Registered: 09/09/05
Posts: 339
Loc: Germany
Ups, yes, you're right! My fault! crazy Thanks for the link!

Top


Moderator:  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | resources | magazine | manual | support faq | bugs

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) 3dgamestudio.net