Gamestudio Links
Zorro Links
Newest Posts
Position Close not possible
by Paul_der_Zweite
12 minutes 3 seconds ago
CSVToHistory.c
by Paul_der_Zweite
56 minutes 58 seconds ago
New Zorro version 1.88
by jcl
Today at 09:35
Options trading questions
by jcl
Today at 09:17
About auto hide invisible entitiesl
by HellThunder
Today at 08:36
Bump with detail?
by Dooley
Today at 05:27
Windows permission issues
by HellThunder
Yesterday at 21:51
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
15 registered (ChrstphFr, Dalla, Ayumi, kvm, MatPed, cepturion, HellThunder, 4 invisible), 448 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
cepturion, Mon3y, vincitytaymo, just, XJohnny_Hoffmann
18057 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: 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

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 Offline
Senior Expert

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