Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (kzhao, AndrewAMD, bigsmack), 824 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Key state? #289226
09/11/09 11:09
09/11/09 11:09
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline OP
Serious User
DJBMASTER  Offline OP
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Hi, this might be a weird question but is there a way to set the key state of a key to 0? I think this is handled by the OS so probably a work-around is better.

Re: Key state? [Re: DJBMASTER] #289230
09/11/09 11:14
09/11/09 11:14
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
The key state? What is that?

Re: Key state? [Re: the_clown] #289235
09/11/09 11:45
09/11/09 11:45
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline OP
Serious User
DJBMASTER  Offline OP
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
when a key is pressed, the 'state' of the key is set to 1 to signify ON. When the key is released it is set to 0 for OFF.

Re: Key state? [Re: DJBMASTER] #289252
09/11/09 12:59
09/11/09 12:59

F
Fear411
Unregistered
Fear411
Unregistered
F



what do you want to do?
Maybe there is an easy workaround.

Re: Key state? [Re: ] #289253
09/11/09 13:02
09/11/09 13:02
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline OP
Serious User
DJBMASTER  Offline OP
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
lol, k i'll try and explain...

I'm moving an entity using this small snippet...
Code:
c_move(me,vector((key_w-key_s)*5,0,0)nullvector,GLIDE);


The only problem is, is that whilst the entity is moving if you switch to another application or another window recieves focus then the entity keeps moving. You can even release the key and it will still continue to move.

I'm not really switching applications, but i'm showing a ContextMenu and so it is not giving the engine "input focus".

I thought using (key_w-key_s)*window_focus*5 would help, but it doesnt seem to work.

Last edited by DJBMASTER; 09/11/09 13:03.
Re: Key state? [Re: DJBMASTER] #289265
09/11/09 13:53
09/11/09 13:53
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline
User
Stromausfall  Offline
User

Joined: Dec 2002
Posts: 616
Austria
when you switch to another application you could disable the input for the application via "enable_key" maybe, that helps!


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread

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