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.

Newcomers AppGameKit Corner / scan code for "+"

Author
Message
guy_design
User Offline
Joined: 1st Mar 2017
Location:
Posted: 27th Dec 2017 03:22
My app want to check calculator sign but AGK2 don't have scan code for "+" .It can use "=" button instead for standard keyboard , but I want to use number pad that "+" button not work.
blink0k
AGK Developer
4
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th Dec 2017 03:49
GetLastChar() will return the last key pressed including + - =
Unfortunately GetRawKeyPressed/Released() do not report those keys
guy_design
User Offline
Joined: 1st Mar 2017
Location:
Posted: 27th Dec 2017 04:19
blink0k THANKS SO MUSH
adambiser
AGK Developer
2
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 27th Dec 2017 05:26
These are the values (at least for Tier 1 code)
107 = numpad plus
192 = numpad divide (this is the same code as the grave accent/tilde key and seems to be a bug, should be 191 to match the forward slash key)
106 = numpad multiply
189 = numpad subtract (also non numpad minus key)
190 = numpad point (also keyboard period)
13 = numpad enter (also keyboard enter)
These don't match what other things use as key codes.

I think they work with GetRawKeyPressed and GetRawKeyReleased.
Rick Nasher
User Offline
Joined: 25th Jul 2017
Location:
Posted: 27th Dec 2017 22:35 Edited at: 27th Dec 2017 22:57
Might be handy:
+ Code Snippet

Call once from start and then for instance in main loop like:

If GetRawKeyPressed(KEY_ESC) then exit
Rich Dersheimer
AGK Developer
8
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 5th Jan 2018 18:39
@Rick Nasher - Nice! I use the same thing, but mine is a text file instead of a function, I just #include it in main file.
Rick Nasher
User Offline
Joined: 25th Jul 2017
Location:
Posted: 6th Jan 2018 00:23
@Rich Dersheimer
Quote: "but mine is a text file instead of a function, I just #include it in main file."


That's actually an even better solution. I'm still thinking in a Blitz3D type of coding, hehehe.

Thanks and cheers.

Login to post a reply

Server time is: 2018-01-23 01:53:23
Your offset time is: 2018-01-23 01:53:23