Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,807,179 Members 41,635 Now Online
XDA Developers Android and Mobile Development Forum

Using hardware keys in games

Tip us?
 
worldextermination
Old
#1  
worldextermination's Avatar
Member - OP
Thanks Meter 25
Posts: 42
Join Date: Jan 2013
Location: Philadelphia, PA
Default Using hardware keys in games

I recently started playing Critical Strike Portable on my LG OG Pro, and I noticed it's hard to aim and shoot at the same time. My fix for this is to assign the button above the volume buttons (default is camera on PAC-ROM) as the fire key. Question is, how do I do this? I assume I'd have to unpack the APK and edit the configuration file to accept the key as fire. But I'm sure I'd have to throw some device specific mumbo jumbo in there to get it to work properly. Can anyone help me out or point me in the right direction? Thank you!

Sent from my LG-E980 using xda app-developers app
 
ramdante
Old
#2  
Member
Thanks Meter 4
Posts: 61
Join Date: Nov 2011
Quote:
Originally Posted by worldextermination View Post
I recently started playing Critical Strike Portable on my LG OG Pro, and I noticed it's hard to aim and shoot at the same time. My fix for this is to assign the button above the volume buttons (default is camera on PAC-ROM) as the fire key. Question is, how do I do this? I assume I'd have to unpack the APK and edit the configuration file to accept the key as fire. But I'm sure I'd have to throw some device specific mumbo jumbo in there to get it to work properly. Can anyone help me out or point me in the right direction? Thank you!

Sent from my LG-E980 using xda app-developers app
Use a ps3 controller over bluetooth instead, if you have that.
 
worldextermination
Old
#3  
worldextermination's Avatar
Member - OP
Thanks Meter 25
Posts: 42
Join Date: Jan 2013
Location: Philadelphia, PA
I don't have one, although I do have an Xbox 360, which I believe is bluetooth as well, but that kind of defeats the purpose.
 
Neroga
Old
#4  
Neroga's Avatar
Senior Member
Thanks Meter 544
Posts: 1,274
Join Date: Feb 2012
Location: Saint Cloud, Florida
I'm not exactly sure what to change it to but editing the hardware buttons is quite simple. Go to /system/usr/keylayout/gk-keypad-8064.kl and change key 250 to something else. I would assume that changing it to 1 would make it type the number 1 so you might be able to assign fire to that hardware button if the app allows it.

Sent from my Optimus G Pro using XDA Premium 4 mobile app
 
worldextermination
Old
#5  
worldextermination's Avatar
Member - OP
Thanks Meter 25
Posts: 42
Join Date: Jan 2013
Location: Philadelphia, PA
Sweet! I'll try it as soon as I get home! Though I'm not sure what I would assign it to, since the game uses touch commands. Is there any way I can edit the game's APK to assign the key to fire only while the game is open?

Sent from my LG-E980 using xda app-developers app
 
Neroga
Old
#6  
Neroga's Avatar
Senior Member
Thanks Meter 544
Posts: 1,274
Join Date: Feb 2012
Location: Saint Cloud, Florida
Quote:
Originally Posted by worldextermination View Post
Sweet! I'll try it as soon as I get home! Though I'm not sure what I would assign it to, since the game uses touch commands. Is there any way I can edit the game's APK to assign the key to fire only while the game is open?

Sent from my LG-E980 using xda app-developers app
I'm no sure. Never got into modifying APKs. There IS an app called Game Keyboard (paid) that allows you to assign hardware keys to touch inputs. It's well worth the few bucks. I use it for just about every game / emulator I have as you can make your own custom layouts.

Sent from my Optimus G Pro using XDA Premium 4 mobile app
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Schedule is up for xda:devcon ’14

With xda:devcon ’14 just around the corner, and the venue close to selling out, there is a lot … more

aLogcat Returns Thanks to XDA Love

The developers of Android, that is Google, gave users several great debugging tools that can be used in … more

And the Winners in the XDA Pebble Development Challenge Are…

Almost two months ago, we set out with Pebble to findthree amazing … more

MediaTek Releases Full Kernel Source for First Android One Devices

Those who might have thought that MediaTek wouldnever release working … more