Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Input from PC key?..

Author
Message
Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 15th Oct 2012 15:33
Hi guys, I am trying to make some PC keyboard inputs in my test program in FE and AppGameKit but nothing...

I am trying the following:
my_up_key = GetRawKeyState( 200 )
result : error

su_key = GetRawKeyState( 0x57 )
result : error

IF keystate(200) = true then print "UP ARROW PRESSED"
result : error

IF keystate(0x57) = true then print "UP ARROW PRESSED"
result error again...

Emmm somebody can teach me how I can obtain my su_key variable 1 or 0 if I am pressing the key or not?

Thanks!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Oct 2012 15:38 Edited at: 15th Oct 2012 15:39
Take a look at the raw commands at the bottom of this page:
http://www.appgamekit.com/documentation/Reference/Input.htm

You can use this to get the last key pressed:
print(str(getRawLastKey()))


this.mess = abs(sin(times#))
Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 15th Oct 2012 15:44 Edited at: 15th Oct 2012 15:44
Thank you baxslash!

I was using wrong key codes!
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 17th Oct 2012 19:50
I would recommend using the codes listed at http://www.appgamekit.com/documentation/guides/scancodes.htm to set up a set of constants

It makes your code much easier to follow and debug.

Alduce
21
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 19th Oct 2012 03:12
Really useful Marl, Thanks!

Login to post a reply

Server time is: 2024-05-04 10:36:43
Your offset time is: 2024-05-04 10:36:43