Gamestudio Links
Zorro Links
Newest Posts
rMomentum always returns 0 when checking for peak/valley
by jcl
Today at 17:38
a little help here?
by 3run
Today at 16:38
How to set a pair trading order right
by jcl
Today at 11:46
Dual Momentum Algorithm - The way Zorro would have done it
by Hredot
Today at 05:21
HIgh FRequency Trading Script -- Highly Profitable
by Yosh
Yesterday at 19:27
Linear Regression in objective function
by jcl
11/22/17 15:40
MT4 vs Zorro
by pascalx
11/22/17 14:00
AUM Magazine
Latest Screens
RPG PARTY
Triton Wing now available on Steam
AckCon'17: Lotter vs The World
Triton Wing
Who's Online
14 registered (Lobo, Hredot, painkiller, 3run, alibaba, Kartoffel, FLD, RealSerious3D, Jerome8911, 1 invisible), 169 Guests and 4 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
ech87, Lobo, Andy60, AzzoCorp, franzz
17813 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: 321
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: 2112
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
Newbie

Registered: 07/03/14
Posts: 46
^--- 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: 321
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 Online
Senior Expert

Registered: 09/13/03
Posts: 6612
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 side-scroller: ~98.5% (??????!??)

Steam® Store Page ("Coming Soon"): http://store.steampowered.com/app/407570 Wowowowow!

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

Registered: 09/09/05
Posts: 321
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