[MOD] Xposed Additions mod: More versatile buttons

gerhardo

Senior Member
Aug 23, 2013
294
91
0
Deactivating solved most problems except one. Double mhome action are gone... may be svoice installing will help...
Tryed to reset additions data. And remap all the keys without volume butons. And its work with gravity box volume keys mapping, but if i wipe cashe\dalvik then problem appers again. If additions media next would skip tracks in neitron like it do with poweramp - all will be good...
The conflict GravityBox and Xposed Additions can occur if you have both modules active at the same time, GB must be patched to not hook into the same functions to be sure. But it mostly works for me, probably a timing issue.
Not really understanding what is going on.

Very interesting behavior ...when i set media next to one click on volume up when screen is off neitron player switch tracks, but the same action on long click make a rewind during current song. Hm - imho that even better )))
For the long click: Is this long-long click?
If you have a short timeout, it can be hard to press long press only.
Set haptic feedback on the button, then you get a notification at long press and long-long press.

One issue I am having, is that sometimes I get random button push events for my USB game controller. I don't have any of it mapped in Xposed Additions. This happens with at least one of my USB hubs. It seems to me that I had this problem several months ago, but that it was resolved in one of dk_zero's <=2.3.8 versions. If this does not make any sense to you, I can go back and test to see if I still have this problem with 2.3.8...
Can you explain some more?
Do you get extra pushes, like bouncing or something else?
Does this require Allow External Devices?
 

gerhardo

Senior Member
Aug 23, 2013
294
91
0
Please have a look at logcat files in attached zip.
They are taken on GNote2 and HTC-J.
Thanks in advance.
Can you confirm that you are using 3.2.2.7? (believe so)
What Android version is used, pre 4.2?
Is this occurring also if the application is not exited, but just Home pressed?
Pre 4.2 is taking another code path. The crash should be avoided of course, even if the action fails.
 

t61p

Senior Member
Mar 10, 2011
85
16
0
Can you confirm that you are using 3.2.2.7? (believe so)
I confirmed once more that the version is 3.2.2.7.

What Android version is used, pre 4.2?
Pre 4.2 is taking another code path. The crash should be avoided of course, even if the action fails.
Ah, this seems to be the reason. Android versions are:
GNote2 : 4.1.1
HTC-J : 4.0.4

Is this occurring also if the application is not exited, but just Home pressed?
No. The reboot happens only after Back pressed then Last Application action invoked.
If Home pressed then Last Application action invoked, the last app becomes foreground as expected.
 

gerhardo

Senior Member
Aug 23, 2013
294
91
0
No. The reboot happens only after Back pressed then Last Application action invoked.
If Home pressed then Last Application action invoked, the last app becomes foreground as expected.
I wanted the last application to switch to the previous application as seen in the Recent applications. That is the easiest to explain and the expected behavior in my view.
dk_zero-cool and GravityBox seem to only activate those where you do not exit, no action at all otherwise.
dk_zero-cool: http://forum.xda-developers.com/showpost.php?p=53869827&postcount=1548

So the options here are:
* Just avoid device reboot when prev app is destroyed for <=4.1
* Fix 4.1 behavior
* Change to GB/dk_cool-zero handling and ignore if previous is destroyed
* Switch to previous app that is not destroyed

I prefer the second, but may settle with the first. Any opinions?
 

t61p

Senior Member
Mar 10, 2011
85
16
0
I wanted the last application to switch to the previous application as seen in the Recent applications. That is the easiest to explain and the expected behavior in my view.
I fully agree with you. This is what I expect too.

So the options here are:
* Just avoid device reboot when prev app is destroyed for <=4.1
* Fix 4.1 behavior
* Change to GB/dk_cool-zero handling and ignore if previous is destroyed
* Switch to previous app that is not destroyed

I prefer the second, but may settle with the first. Any opinions?
So, the third option and the fourth option are excluded. Is the second option the best, as you prefer? I don't understand very well the exact behavior of the first option and the second option.
By the way, did you ask dk_cool-zero to merge your Last application function to orignal XposedAdditions?
 

gerhardo

Senior Member
Aug 23, 2013
294
91
0
So, the third option and the fourth option are excluded. Is the second option the best, as you prefer? I don't understand very well the exact behavior of the first option and the second option.
By the way, did you ask dk_cool-zero to merge your Last application function to orignal XposedAdditions?
If 2 is not too hard to do it is of course preferred to 1.
But to be honestit is not my highest prio and I will not rollback my private phone to test it. So you may have to test it...

I have not explained the changes in detail. Had planned to respond to the post I linked to, but want to clear your issue first.
dk_cool-zero say he is slowly merging my patches.
 
  • Like
Reactions: t61p

t61p

Senior Member
Mar 10, 2011
85
16
0
If 2 is not too hard to do it is of course preferred to 1.
But to be honestit is not my highest prio and I will not rollback my private phone to test it. So you may have to test it...
Sure. I understand it's not your highest priority. Please don't spend too much time. If I give up to use the Last application action for now, at least it's possible to avoid annoying device reboot. I will of course be available for the test in case you improved something.

I have not explained the changes in detail. Had planned to respond to the post I linked to, but want to clear your issue first.
I see. Concerning about the post, I understand his thinking, though I prefer your Last application behavior.

dk_cool-zero say he is slowly merging my patches.
So hopefully, the Last application action will be available in original XposedAdditions. I think your Last application action and his Previous application action can be co-exist as different behavior for user's choice.

Finally, you may already know that I'm asking dk_zero-cool in his thlead about the re-mapping issue to the Recent App button on HTC-J device. The issue is that any re-mapped action to the Recent App button is totally ignored. BUT, the re-mapped action works fine with your 3.2.2.7 version! So you might notice and modify something when you implement your improvement. May I ask if you have any hint?
 

Hypocritus

Member
Oct 8, 2006
40
7
0
Washington, D.C.
Hey gerhardo. This is still my favorite version of XA, b/c my sleep2wake is "instant" and unquirky. Any chance you could make a 3.2.2.8 with the "Last App" function working? On my EVO 3D 4.0.4 it soft-reboots...
 

gerhardo

Senior Member
Aug 23, 2013
294
91
0
Sure. I understand it's not your highest priority. Please don't spend too much time. If I give up to use the Last application action for now, at least it's possible to avoid annoying device reboot. I will of course be available for the test in case you improved something.

So hopefully, the Last application action will be available in original XposedAdditions. I think your Last application action and his Previous application action can be co-exist as different behavior for user's choice.

Finally, you may already know that I'm asking dk_zero-cool in his thlead about the re-mapping issue to the Recent App button on HTC-J device. The issue is that any re-mapped action to the Recent App button is totally ignored. BUT, the re-mapped action works fine with your 3.2.2.7 version! So you might notice and modify something when you implement your improvement. May I ask if you have any hint?
Hey gerhardo. This is still my favorite version of XA, b/c my sleep2wake is "instant" and unquirky. Any chance you could make a 3.2.2.8 with the "Last App" function working? On my EVO 3D 4.0.4 it soft-reboots...
Last App/Previous App:
I consider that just a renaming, will propose "my" definition when the fix for the reboot is done. (Keeping "both" is even more confusing.) But I need a little setup and have some rest-of-life to complete too. (So I do not completely ignore you <4.2 users, you are just not important enough ;)).
That is planned for 3.2.x

The difference for Recent apps is some policy flags said dk_zero-cool.

Other than that, I am waiting for a good time to merge with dk_zero-cool 3.3 changes too. But I do not feel like reimplementing for a third time, so I am not rushing.
 
  • Like
Reactions: Hypocritus

Hypocritus

Member
Oct 8, 2006
40
7
0
Washington, D.C.
Last App/Previous App:
I consider that just a renaming, will propose "my" definition when the fix for the reboot is done. (Keeping "both" is even more confusing.) But I need a little setup and have some rest-of-life to complete too. (So I do not completely ignore you <4.2 users, you are just not important enough ;)).
That is planned for 3.2.x

The difference for Recent apps is some policy flags said dk_zero-cool.

Other than that, I am waiting for a good time to merge with dk_zero-cool 3.3 changes too. But I do not feel like reimplementing for a third time, so I am not rushing.
Sure gerhardo, no problem. Thanks for all you have contributed!!:D I already have a higher quality of life from your contributions!:eek:
 

gerhardo

Senior Member
Aug 23, 2013
294
91
0
Updated to 3.2.8, for Android <= 4.1 that could reboot when toggling apps.
I did not spend too much time on it, but did not find a way to activate closed apps, so it is scenario 1 above.

...and my TrueSmart hanged yesterday, screen off. Buttons gave haptic feedback but no action, no reboot after 15s.
I added an extra haptic feedback for longer press to see if this long-long-long press is detected at this point. I assume so, but no idea why the device did not reboot. Maybe need some other way than using the PowerManager. The firmware is crappy.
 
  • Like
Reactions: Hypocritus and t61p

t61p

Senior Member
Mar 10, 2011
85
16
0
Updated to 3.2.8, for Android <= 4.1 that could reboot when toggling apps.
I did not spend too much time on it, but did not find a way to activate closed apps, so it is scenario 1 above.
Hi. I've confirmed that device reboot no longer happens by Last application action to closed apps on GNote2(4.1.1) and HTC-J(4.0.4). Thank you very much.
 

gerhardo

Senior Member
Aug 23, 2013
294
91
0
If anyone wonders what is happening, dk_zero-cool has merged some changes in 3.3/3.4. I have reimplemented my patches for 3.3 and 3.4 and dk_zero-cool started to look at them a couple of weeks ago. (So I have implemented this 4 times now).
If no update for the merge I will probably release a new build (for 3.4) in a week or so.

Edit: 3.4.1.1 released
 
Last edited:

Spere

Senior Member
Aug 7, 2013
465
165
63
Hi!

Just came here from Xposed Additions thread.

This mod looks interesting, need to test this when I got time. Problems I have with Xposed Additions (problems that makes it almost unusable for me) is that when I remap keys of my external BT keyboard I got two problems.

1. There comes huge delay to typing - when I type normal speed, letters come pretty randomly (When I type 'test' it comes 'tets' or so). But isn't this fixed on this mod since unmapped keys are not handled (well I'll find this out when I have time to try)

2. I need scandinavian keyboard layout to be able to type (need ä and ö). When I enable external devices on original Xposed Additions my keyboard layout changes to EN/US without any reason. This loses those important letters from me and typing comes pain and impossible.

So what I'm trying to ask here is that are you able/interested to fix problem 2 (and 1 if it's not fixed already)

Regards
 

gerhardo

Senior Member
Aug 23, 2013
294
91
0
So what I'm trying to ask here is that are you able/interested to fix problem 2 (and 1 if it's not fixed already)
I can see why dk_zero-cool got tired of debugging Samsung haptic feedback and I am not going to go there....
Another limiting factor is the hardware. I primarily develop on the emulator and do not have BT keyboard.
I try to balance costs from sparetime dev to the zero income I have, so I have not planned to get one either...

That said, sure. I consider looking in to this. Problem 1. works well in the emulator (GENyMotion).
For 2., GENYmotion do not support other layouts (cannot type åäö at least) and standard emulator is not rooted (should be possible, have not investigated deeply).
So I cannot investigate.
However, also 2. may be handled by pass-though.

Do you need to route keyboard presses via Xposed Additions, is it not enough to untick external keyboard?
 
  • Like
Reactions: Spere

Spere

Senior Member
Aug 7, 2013
465
165
63
Do you need to route keyboard presses via Xposed Additions, is it not enough to untick external keyboard?
Well, like I said I haven't got time to test this yet if problem 1 aint any problem in this mod.

The reason I 'need' external devices to be enabled is that at first place I got Xposed Additions for BT keyboard, even though it's not made for them primarily. I got Rapoo E6700 keyboard and I wanted to be able to add shortcuts and different functions to F1-F12 (and some other) keys like: opening certain apps, controlling media volume, changing display brightness, home, back, kill app, recents, etc. etc.

That keyboard aint made android in mind, but it works as it should on my Note Pro 12.2. With Xposed Additions I can make those shortcuts work, but I had that problem with lag (1) and losing åäö (2) that made it unusable.

I asked dk_zero-cool about these couple of times but never got anykind response.

Now, when I got time I need to test this (tomorrow or the day after, I hope) to see if 2. is also handled by pass-through.

I'll keep you posted how it goes!


Edit

Tried this mod now.
When I check "Check Unconfigured Primary Key" typing delay is gone + 'åäö' are working like they should. Now only problem I'm facing is some Fx keys are seen as double keys, like F9 = "Meta Left+Q" so when I have problems 1 and 2 fixed, I can't use all keys.
@gerhardo Is there any way to fix this. Like when you press certain key ---> module listens for multi-key event but otherwise not. "Meta left" means here Windows-button on my keyboard and obviously there's no need for that on android devices. Instead I coud use Win+'button' combination to create almost unlimited actions with this module.


Thanks anyway! Your mods made this module usable for me by fixing those two problems!!
 
Last edited:

gerhardo

Senior Member
Aug 23, 2013
294
91
0
Now only problem I'm facing is some Fx keys are seen as double keys, like F9 = "Meta Left+Q" so when I have problems 1 and 2 fixed, I can't use all keys.
@gerhardo Is there any way to fix this. Like when you press certain key ---> module listens for multi-key event but otherwise not. "Meta left" means here Windows-button on my keyboard and obviously there's no need for that on android devices. Instead I coud use Win+'button' combination to create almost unlimited actions with this module.
XA uses the key code reported by the button, so F9 to MetaLeft+Q may just be the presentation.

To use a key in multi-key combination, you must map the first key to something (actually, not entirely required, but this is quite complex, will need some time to investigate this).

If it still is an issue, you can try to enable debug and send a logcat. But I probably need a similar keyboard to get to it. So no big hopes...
 

Spere

Senior Member
Aug 7, 2013
465
165
63
If it still is an issue, you can try to enable debug and send a logcat. But I probably need a similar keyboard to get to it. So no big hopes...
Forget hidden part. Read again what you said and mapped Windows button to 'something'. Now everythings working fine!:p

Yes, played a little more with this. Now all Fuction buttons 1-12 works like they should, also was able to map Win+0-9 buttons to open apps. Thank you one more time!

What kind of log you need? I need to do something specific before sending log?

Attachment log that should go this way:

Code:
Check Unconfigured Primary Key: [I]Unchecked[/I]

Press F11 (MetaLeft+K) [this opens recent apps]
Press Esc (Back) [to close recent apps]
Press Windows (MetaLeft)
Press Windows+K (MetaLeft+K) [this opens recent apps]
Press Esc (Back) [to close recent apps]

-----------

Check Unconfigured Primary Key: [I]Checked[/I]

Press F11 (MetaLeft+K) [nothing happens since multikey events are ignored]
Press Windows (MetaLeft)
Press Windows+K (MetaLeft+K) [nothing happens since multikey events are ignored]
What I would like to have here is that when Unconfigured Primary Key is Checked to avoid latency and messing layout. Same time specific keys could be listened for multikey event. In my case this MetaLeft which is Windows button which keycode is 117?

And if you find out way to do this, I don't care how those specific buttons need to be 'enabled' for multi-key events. If you could enable them same way like adding new keys to Xposed Additions, or if you need to find keycode yourself and put in in configuration file somewhere on your system. Or for this particular MetaLeft, I don't care even if you hardcode it to your mod and make (or make not) an on/off switch for it.

What I'm trying to say here is. If you have time and motivation to investigate and even to do this, seeing that you don't even have BT keyboard and thus no use for this feature(?), I'm more that very thankful for you!!!
 

Attachments

Last edited:
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone