Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by NeoDumont
Today at 04:24
New Aum and few things
by George
Yesterday at 20:47
Transfer free license to different device?
by AndrewAMD
Yesterday at 20:14
read MT4 tradehistory html to create tradereport in Zorro
by GHMC
Yesterday at 13:45
Oanda - Darwinex data syncronisation
by MatPed
06/16/18 17:13
Genetic Algorithm
by AndrewAMD
06/16/18 06:09
Sponsorship
by Firoball
06/15/18 21:55
AUM Magazine
Latest Screens
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Forgotten Tales - Demo version
RPG PARTY
Who's Online
7 registered (mk_1, jenGs, Superku, alibaba, AndrewAMD, 20BN, 1 invisible), 475 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
Raisinbran, Grodt, drack, Paul_der_Zweite, madeinquant
17981 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: 341
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 Offline
Expert

Registered: 06/11/09
Posts: 2210
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: 69
^--- 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: 341
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: 6707
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: 341
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 | Data Protection Policy

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