How to find GPIO hardware key int values from kernel source - Galaxy S 4 Developer Discussion [Developers-Only]

Hello--first, my goal is to fork the device_samsung_jf-common repo from CM or RootBox and make some small mods on the hardware buttons--specifically, add support for the device's home double-tap functionality, which is featured in the Google Play edition (GT-I9505G). I know I can do this by modifying the keylayout, etc. However, the existing .kl files don't address all the hardware buttons on the device.
Now, I did a quick search and pulled up this thread, which was informative. However, I'm trying to find the int values for each of the hardware buttons on the device, and I imagine long-press or double-press is likely mapped a bit differently than a normal single press. Even after poring over the source code for the I9505G's 4.3 kernel and documentation (searching for phrases like app_switch and GPIO, home, back, etc.) I still haven't found the part of the source that would illustrate which ints resolve to which hardware buttons.
Any ideas how to find the key ints for all the hardware buttons, including long-press and double-click?

my best guess would be looking into the custom ROMs already out there. If I recall correctly some already implement the functionality you seek and you might be able to find the corresponding code changes in their respective repos.

ThugEsquire said:
Hello--first, my goal is to fork the device_samsung_jf-common repo from CM or RootBox and make some small mods on the hardware buttons--specifically, add support for the device's home double-tap functionality, which is featured in the Google Play edition (GT-I9505G). I know I can do this by modifying the keylayout, etc. However, the existing .kl files don't address all the hardware buttons on the device.
Now, I did a quick search and pulled up this thread, which was informative. However, I'm trying to find the int values for each of the hardware buttons on the device, and I imagine long-press or double-press is likely mapped a bit differently than a normal single press. Even after poring over the source code for the I9505G's 4.3 kernel and documentation (searching for phrases like app_switch and GPIO, home, back, etc.) I still haven't found the part of the source that would illustrate which ints resolve to which hardware buttons.
Any ideas how to find the key ints for all the hardware buttons, including long-press and double-click?
Click to expand...
Click to collapse
If I remember they did this with the HTC One S and the One i would check there it remapped the hardware or capa functions
Sent from my GT-I9505G using Tapatalk 2

There's an app online that lists them for you, I forget where exactly I saw it

Related

Button mapping utility?

Is there any button mapping utility that will allow me to map one of the hardware buttons to a keystroke? Specifically, the ~ keyboard.
AE Button Plus?
I was going to say, AE Button Plus. But not according to the program's main page or screenshots.
mapping a button for a single keystroke is a little ridiculous. im not sure you're going to find any app that does this. it doesnt seem like anyone would waste their time making something like that when you have a built in keyboard with all the buttons. the fastest way to get a ~ symbol is to press Function and Q so you get the ' @ ', then press Function and Space to get turn @ into ~.
or, double press function, then press Q followed by Space
Incredible as it may seem, such a program exists, and better yet, its donateware.
Part of the amazing vijay555 site:
http://www.vijay555.com/?Releases:VJKeyPress
ebb said:
Incredible as it may seem, such a program exists, and better yet, its donateware.
Part of the amazing vijay555 site:
http://www.vijay555.com/?Releases:VJKeyPress
Click to expand...
Click to collapse
Though it won't work on android, some of the Linux guys may be interested in talking to the developer to solve some of their problems with the hardware buttons.
You could write a very (and I do mean very) simple mortscript and assign it to a hardware button as well.
For example, here is the contents of a mortscript you could write
Code:
Sendkeys ~
That would be the whole script...one line. If you wanted to get fancier, you could have the script do the ~ only if you are in a certain app. Otherwise, it would retain the original function, but that would take a little more coding.
To answer the above question.... I can't use the Function Sym in the program I am using (Logmein), so I need to figure out something different.
The above program sounds good. Where can I find a list of keycodes, or what is the keycode for the ~?
Thanks!

[Request][Mod] Flip search button function

I seldom use the search function on my n1 (quick press search button), compared to my shortcut (long press search button).
I'd love to have the function on the button flipped, so that only when I long press search I get to search, but simply quick pressing it brings me to quickdesk (my shortcut)
There has got to be others interested in this, but I can't find any solution on how to solve it..
Can somebody help me out?
Regards
-e
I THINK someone looked at this before, and without having an app running actively ALL the time to remap the default single press keys, its impossible.
dogiedogie said:
I THINK someone looked at this before, and without having an app running actively ALL the time to remap the default single press keys, its impossible.
Click to expand...
Click to collapse
Or i assume, editing the framework from source ? Like how wysie did it with long-press home-button. If u dont know what im referring to try cm6.
The home button long press change in cm6 is really nice.
Wondering how deep in the OS/framework these changes are..
Basically the OS should register the 4 "hardware" buttons the same way, so if one can be changed, all should be able to be changed..
Also since I just wanna swap functions, there is no need for a gui/front end to control the changes or map certain programs to it.
(I wouldn't complain if cm6 got a full search button control for both short and long press though)
Sounds like something that could be baked into a cm rom if enough people was interested in it..
-e
It should be possible, but I took a brief look at the source and couldn't find it -_-. Will look harder next week. (Weekend's here )
Glad to see you all liking the home button binding change .
I was actually thinking about this after seeing the MT Slide ad... All the genius button is is the search button binded to a skinned voice dialer (if it's even skinned, haven't looked into it)
Wysie said:
It should be possible, but I took a brief look at the source and couldn't find it -_-. Will look harder next week.
Click to expand...
Click to collapse
Massive props to you if you can pull this off!
Looking forward to some good news next week
Key Mapping
This is a good resource: http://www.kandroid.org/android_pdk/keymaps_keyboard_input.html#androidKeymapKeyCharMap.
Would be awesome if you could pull this off
Wysie said:
It should be possible, but I took a brief look at the source and couldn't find it -_-. Will look harder next week. (Weekend's here )
Glad to see you all liking the home button binding change .
Click to expand...
Click to collapse
Sent from my Nexus One

[Q] Samsung screen capture service source code?

So it seems the SGS2 added some functionality eg. power + home for screen cap, hold menu for search, double home for vlingo.
Question is, does anyone know whether these are in the source code that Samsung released at all? I searched the files for keywords like 'screen capture' to no avail.
I'm trying to make an app that changes the way the volume key behaves - long press for 'media next' but found out that android services can't listen for keyevents.. or so I told. That's why I'm trying to find out how samsung is doing this.
My i9100 built-in Screen Capture Service default output is png format. How can I change it to jpeg format?
yeah mine does that too.. I can't find any configuration for us users so unless samsung releases the source code there is no easy way to change it. whats wrong with png?

[Q] How do I change the function of hardware keys (Mic Button, Volume rocker, etc)?

I'm ultimately looking for a way to play/pause and skip music without turning on the screen. I had an HTC Hero a while back running CM7 RC, and I had a few options for this. Holding the volume rocker up or down skipped the song forward and backwards respectively, and when I had a headset in, the Mic button could also have these functions. A single press would play/pause, or answer a call (depending on phone state), double tap would skip the song, and a long press would activate voice search.
I now have the Epic 4G, and none of these functions work anymore. The volume rocker just changes the volume, and the mic button only answers calls, or activates voice dialing, and even then, the screen has to be on and unlocked. I find this of mild annoyance. I haven't found any obvious way to change these settings.
Basically, I want to know how do I change the function of hardware keys? Specifically, the mic button on a wired headset and the volume rockers for music functions.
If u r on cm7 hold the volume down and it will change the song.
Sent from my MIUI.us Sensation 4G using XDA App
vabeachfc3s said:
If u r on cm7 hold the volume down and it will change the song.
Sent from my MIUI.us Sensation 4G using XDA App
Click to expand...
Click to collapse
I knew that already, but I'm not running CM7 on my Epic 4G, nor can I as it's still in Alpha testing. I'm asking how do I configure those shortcuts on a phone that's not running CM. I'm rooted running RandomROM Thunderhawk btw.
jerm1027 said:
I knew that already, but I'm not running CM7 on my Epic 4G, nor can I as it's still in Alpha testing. I'm asking how do I configure those shortcuts on a phone that's not running CM. I'm rooted running RandomROM Thunderhawk btw.
Click to expand...
Click to collapse
It only works on CM based roms due to the root exploits they use to change the hardward key layout that the normal Google code doesn't allow.
zelendel said:
It only works on CM based roms due to the root exploits they use to change the hardward key layout that the normal Google code doesn't allow.
Click to expand...
Click to collapse
I don't mean to be rude, but seriously, I shouldn't have to repeat information.
jerm1027 said:
I'm ultimately looking for a way to play/pause and skip music without turning on the screen. I had an HTC Hero a while back running CM7 RC, and I had a few options for this. Holding the volume rocker up or down skipped the song forward and backwards respectively, and when I had a headset in, the Mic button could also have these functions. A single press would play/pause, or answer a call (depending on phone state), double tap would skip the song, and a long press would activate voice search...
... I want to know how do I change the function of hardware keys?
Click to expand...
Click to collapse
jerm1027 said:
I'm rooted running RandomROM Thunderhawk btw.
Click to expand...
Click to collapse
So, let me clarify. How do I configure hardware keys on a rooted phone that is not, nor can not, run CM?
jerm1027 said:
I don't mean to be rude, but seriously, I shouldn't have to repeat information?
Click to expand...
Click to collapse
Did you not read my reply. The normal Google code doesnt allow it. You have to rewrite the alot of the system coding for it to work.
zelendel said:
Did you not read my reply. The normal Google code doesnt allow it. You have to rewrite the alot of the system coding for it to work.
Click to expand...
Click to collapse
Did you not read my signature or one of my earlier posts? I'm not running normal Google code either. On top of that, I have root access, so there shouldn't be anything I can't change or configure. That's the beauty of Linux. At this point, I'm starting to think I learn some programming and just analyze the code myself. -_-
jerm1027 said:
Did you not read my signature or one of my earlier posts? I'm not running normal Google code either. On top of that, I have root access, so there shouldn't be anything I can't change or configure. That's the beauty of Linux. At this point, I'm starting to think I learn some programming and just analyze the code myself. -_-
Click to expand...
Click to collapse
Your right you would need to learn to code and then rewrite the base coding for how the system controls the hardware keyboards. Now let me let you in on a little secret. Anything other then CM based roms use the default google coding as a base. Root access doesnt mean you have complete control over your hardware. There are alot of things you cant change and configure without rewritting the coding from the ground up like CM did.
And that is what XDA is here for to help you learn to do these things yourself.
Root access doesnt mean you have complete control over your hardware.
Click to expand...
Click to collapse
Odd, I thought root meant exactly that I have complete control over the system. In fact, here was Wikipedia has to say on the subject:
In Unix-style computer operating systems, root is the conventional name of the user who has all rights or permissions (to all files and programs) in all modes (single- or multi-user)
Click to expand...
Click to collapse
Unless it's lock out that's lower than the Android OS (ie BIOS), there shouldn't be any reason why I'm prevented to modify key settings. I know with Debian-based distros, shortcuts keys depended on the Desktop Environment.
I know it's possible to change the function of hardware keys because Dolphin browser can change my volume rocker to change tabs in the browser instead of adjusting volume.
And just because other versions of Android uses the default Google Code base doesn't mean it's the exact same code base. I'm pretty sure a total rewrite of the entire code base isn't necessary to make a modification.
You have to remember that each device uses propriety drivers for things like this. These drivers are not open source. CM roms use different drivers then OEM.
As for dolphin browser I am not sure as my version doesn't do it.
Shoot on over to the CM site and ask how they did it and see what they say. Good luck on you hunt and learning.
Maybe you should try this App:
http://forum.xda-developers.com/showthread.php?t=850464
Don't know excactly if this will solve your issue, but its made for changing functionallity of your (hardware) buttons. And sounds like that's excactly what you want.
Try and take a look at this:
http://forum.xda-developers.com/showthread.php?t=1334871
It's a flashable tweaks addon that (among other things) makes you able to skip tracks with long press on volume up/down. (Only works on EVO 3D though, and on Sense 3.0).
But i'm very limited in the knowledge of coding, so i dont know whether or not this can help you, but its worth a shot
Headset button controller app play store link
Hopefully you found a fix already, but if not, I just came across this. Hopefully it solves the problem:
https://play.google.com/store/apps/...um=organic&utm_term=headset+button+controller

[MOD][XPOSED][4.0+]XUpDown: use volume keys for paging

As a long-time PalmOS user, I hate the fact that Android doesn't have page up/down keys. So I made a little xposed module that lets you use the volume up/down keys as pageup/pagedown keys in apps you choose.
This won't work for apps that don't support the pageup/pagedown keys. I mainly wanted it for Chrome, and it works great there, though. To adjust volume with this active, pull down the notifications, and then volume keys should work as volume keys.
Current support: For Android <7, should work normally with xposed. For Android >=7, needs lsposed or edxposed.
direct download: https://github.com/arpruss/xupdown/blob/master/app/release/app-release.apk?raw=true
source code: https://github.com/arpruss/xupdown
Great idea
But after severals times, physical buttons can have physical problems if we use these buttons several times..
And i would like to know what apps have this fonctionnality
Great works :good:
Rom said:
But after severals times, physical buttons can have physical problems if we use these buttons several times..
Click to expand...
Click to collapse
Only if the hardware is defective or of poor quality, I assume. I guess, though, manufacturers might not design the volume keys for as frequent pressing as the navigation buttons on a Palm were. (And those eventually would require cleaning.)
And i would like to know what apps have this fonctionnality
Click to expand...
Click to collapse
Fewer than I would wish. Fortunately, most browsers seem to support the page up/down buttons on external keyboards. I haven't found an office suite that does, though.
I expect a lot of ebook software will support the paging buttons, but good ebook software tends to already have an option to page with volume keys, so it won't need XUpDown.
arpruss said:
Only if the hardware is defective or of poor quality, I assume. I guess, though, manufacturers might not design the volume keys for as frequent pressing as the navigation buttons on a Palm were. (And those eventually would require cleaning.)
Fewer than I would wish. Fortunately, most browsers seem to support the page up/down buttons on external keyboards. I haven't found an office suite that does, though.
I expect a lot of ebook software will support the paging buttons, but good ebook software tends to already have an option to page with volume keys, so it won't need XUpDown.
Click to expand...
Click to collapse
Ok, thanks for your informations
Sadly it does not work on Cyanogenmod 11 (n7100). Nothing happens in every App I used (even in this App itself).
Just to check the obvious, did you enable xUpDown in XPosed and reboot? And are the apps you want checked in the xUpDown list?
Have you tried Chrome?
Great idea. Works perfect here.
Nexus 5 with Chrome beta.
When the keyboard is up, volume keys move the cursor; when it's not up, they send Pag
Yay, it works! At least in some applications.
Request: make this compatible with modules that use the volume keys to move the cursor when the keyboard is up. Or include a function to move the cursor when the keyboard is up in this module. When the keyboard is up, volume keys move the cursor; when it's not up, they send Page Down/Up.
Cerberus_tm said:
Yay, it works! At least in some applications.
Request: make this compatible with modules that use the volume keys to move the cursor when the keyboard is up. Or include a function to move the cursor when the keyboard is up in this module. When the keyboard is up, volume keys move the cursor; when it's not up, they send Page Down/Up.
Click to expand...
Click to collapse
That's a nice idea. Can you point me to source code for a module like that?
arpruss said:
That's a nice idea. Can you point me to source code for a module like that?
Click to expand...
Click to collapse
Ah, I should have done so in the first place. This would be great! I believe you can find the source code from a sub-module in Xblast here, in VolKeysCursor.java:
https://github.com/FemBlack/XblastTools/tree/XBlastTools-1.5.2/src/ind/fem/black/xposed/mods
I think there are also other Xposed modules that do this btw.
Try the 0.02 beta release at https://github.com/arpruss/xupdown
Press MENU to activate this option.
arpruss said:
Try the 0.02 beta release at https://github.com/arpruss/xupdown
Press MENU to activate this option.
Click to expand...
Click to collapse
How would I go about installing this via Xposed? I am wanting a module with cursor keys but don't want to use Xblast or gravitybox as I am on a touchwiz ROM. Your minimal module sounds ideal.
In Xposed even though I set it to show experimental modules your 0.02 did not show up, just the 0.01 version
Thanks
Darren
You should be able to download the apk from the github page and just install it manually.
arpruss said:
You should be able to download the apk from the github page and just install it manually.
Click to expand...
Click to collapse
I don't see an apk file in the link you supplied ( https://github.com/arpruss/xupdown ). I can see 3 folders (assets, res, src/mobi/omegacentauri/xupdown) and 4 files (LICENSE, icon.svg, icon512.png, resize.sh).
In the 3 folders I only see subfolders (in res), .png, .xml and .java files. I cannot see a .apk file anywhere.
Am I missing something obvious?
Thanks
Darren
That's interesting. The mobile version of the github page doesn't have the releases link. Anyway, it's here: https://github.com/arpruss/xupdown/releases
arpruss said:
That's interesting. The mobile version of the github page doesn't have the releases link. Anyway, it's here: https://github.com/arpruss/xupdown/releases
Click to expand...
Click to collapse
Managed to download it and the cursor key direction works on my Samsung Note 2 (N7100) [emoji7]
2 small points...
1 - Toggling the cursor option via MENU does not being up a "reboot to apply" message. The newly toggled option does not work instantly (it keeps the original setting), you need to reboot. Not a big issue as users will generally "set and forget" the option once. Also it is a common approach on Xposed modules to reboot after changes. It is just that some modules (or is it Xposed itself) put a notification up to reboot.
2 - You might want to add on your module description that it handles keyboard cursor movement. Without that nobody will find your module when doing a search with the Xposed app (my usual method of finding cool stuff). I only found your module by googling once I tried all Xposed apps from the Xposed search method.
Thanks very much
Darren
I haven't figured out yet how to inform the Xposed framework about changes and the need for a reboot. I guess I should look at the source code of a few more modules.
Actually, strictly speaking you don't need a reboot when you change the settings, but you do need to kill the apps if they are running or else the new settings don't take.
This is great, especially since StatusBar Scroll to Top is dormant and doesn't work with Chrome. If it works by making the volume keys act like pgup and pgdn, would it be possible to make long presses on them work like Home and End? Holding down does scroll plenty fast for all but the longest pages though.
Oops, I missed the update to 0.2. Cursor control works! But, alas, page up/down doesn't seem to work anywhere, at least not in Chrome, Dolphin, stock LG browser, Dropbox. I have turned off Gravity Box and Xblast, and the volume-key options in the G3 TweakBox (long-press volume up when screen is off to toggle toch). So perhaps my ROM is just incompatible, CloudyG2 (latest version). But still nice work to have integrated those two functions!
Hello, I'm a very newbie in Android development.
First of all, thank your for your great Xposed app.
I wanted to try out with a different keycode (DPAD_UP/DOWN) instead of PAGE_UP/DOWN because many of my apps other than Chrome do not scroll with PAGE_UP/DOWN keys.
I've downloaded the ver 0.02 source code from github and tried to build the app, but with no success. I've got bunch of dependency/reference errors.
Could someone point me to the required prerequisite to compile XUpDown from the source?
-Required Android SDK/build tools version
-IntelliJ/ADT/Eclipse version
-Original AndroidManifest.xml file
-XposedBridgeApi-??.jar version
Thank you very much for your help.

Categories

Resources