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 / Detect android back key and menu/action key?

Author
Message
2D Analyst
AGK Developer
20
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 20th Oct 2012 07:56
Is there a way to detect the back button and menu button on android phone?
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 20th Oct 2012 10:34
escape key is the same as back key on android

Havent messed with the menue key?

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 20th Oct 2012 12:34
For the Back Button:



And we do not have access to the Menu button at the minute (at least in Tier 1)...
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 20th Oct 2012 15:53
Ahere is some of the others from one of my code projects.


Initiate_Keyboard:
#constant False 0
#constant True 1

#constant KB_esc 27
#constant KB_tab 9
#constant KB_back 8
#constant KB_space 32
#constant KB_enter 13
#constant KB_shift 16
#constant KB_ctrl 17

#constant KB_up 38
#constant KB_down 40
#constant KB_left 37
#constant KB_right 39

#constant KB_0 48
#constant KB_1 49
#constant KB_2 50
#constant KB_3 51
#constant KB_4 52
#constant KB_5 53
#constant KB_6 54
#constant KB_7 55
#constant KB_8 56
#constant KB_9 57

#constant KB_np_0 45
#constant KB_np_1 35
#constant KB_np_2 40
#constant KB_np_3 34
#constant KB_np_4 37
#constant KB_np_5 12
#constant KB_np_6 39
#constant KB_np_7 36
#constant KB_np_8 38
#constant KB_np_9 33

#constant KB_a 65 ,
#constant KB_b 66
#constant KB_c 67
#constant KB_d 68
#constant KB_e 69
#constant KB_f 70
#constant KB_g 71
#constant KB_h 72
#constant KB_i 73
#constant KB_j 74
#constant KB_k 75
#constant KB_l 76
#constant KB_m 77
#constant KB_n 78
#constant KB_o 79
#constant KB_p 80
#constant KB_q 81
#constant KB_r 82
#constant KB_s 83
#constant KB_t 84
#constant KB_u 85
#constant KB_v 86
#constant KB_w 87
#constant KB_x 88
#constant KB_y 89
#constant KB_z 90
return

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 20th Oct 2012 16:24
Is that all the keys on the keyboard, making them into constants is a pretty good idea
2D Analyst
AGK Developer
20
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 20th Oct 2012 17:52
Thanks! How did you know what number is mapped to which button?
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 20th Oct 2012 17:54 Edited at: 20th Oct 2012 17:55
Just out of interest, what's the advantage of using a Constant over a Global Variable? That may seem like a dumb question, but I'm relatively new to this so would like to know what the benefits are, if any? Are Constants quicker than Global Variables? Or is it just a programmers preference? (2D Analyst, sorry for hijacking your post, but I think you have your answer now, right?)...

EDIT: 2D Analyst, check this link out... It contains the Scan Codes (Key Numbers):

http://www.appgamekit.com/documentation/guides/scancodes.htm
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 20th Oct 2012 17:57
Quote: "Constants quicker than Global Variables?"

Constants are slightly faster as they never change.

Global values are neaded to be checked if they have changed.

But this is about milli milli milli seconds

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz

Login to post a reply

Server time is: 2024-05-04 13:34:25
Your offset time is: 2024-05-04 13:34:25