FORUMS

What Features Do You Look for in a Gallery App?

With so many different options to choose from, finding the right Gallery app may be a … more

Google Photos ‘Unlimited’ Storage Reportedly Being Capped

When Google Photos was announced, many of us thought very highly … more

Sprint Moves to Lift Video Streaming Limit for All-In

Yesterday, Sprint announced a new unlimited scheme that offered customers an … more

Xiaomi Releases Kernel Source Code For Mi4i

If you’ve been following the XDA News Portal lately, you might have noticed an … more

Xserver chroot on TF700t

1,210 posts
Thanks Meter: 507
 
By workdowg, Senior Member on 6th January 2014, 11:10 PM
Post Reply Subscribe to Thread Email Thread
12th January 2015, 09:07 PM |#11  
Junior Member
Thanks Meter: 5
 
More
Quote:
Originally Posted by _that

Try playing with the kernel level function key remapping that I added in my kernel:
http://forum.xda-developers.com/show...42&postcount=3

If you're not using my kernel, you need to extract the patch that implements this feature from my kernel on github and compile your own.

Great! It works!
I can write parameters even from inside the chrooted environment.
Now I only have to change remapping of function keys done by XServer XSDL in order to avoid "double" remapping of the same key, and I am done
Thank you!

_that's Kernel key remapping function works perfectly, I can use the following commands (in Android terminal or within the chrooted environment, as root in both cases) to enable Esc, Del, Ins keys, and to use special keys as Function keys without needing to press Alt/Alt Gr:
Code:
echo 3 > /sys/module/asusdec/parameters/key_flags
The problem is XServer XSDL.

Problem 1:
Xserver XSDL sees Esc, Del and Ins keys (corresponding to Back, Lock, Volume Mute dock keys) as if they were the same key, that in the default XServer XSDL config is mapped to 'Unknown'.
So even if you try to remap them, you can choose only one option for ALL of them.

Solution:
Do not touch XServer XSDL default key mapping settings .
Follow my previous post, point 2, and add to the $HOME/.lircrc config file the following lines:
Code:
begin
	prog = irexec
	remote = /dev/input/event1
	button = KEY_ESC
	config = xte 'key Escape'
	repeat = 0
end

begin
	prog = irexec
	remote = /dev/input/event1
	button = KEY_DELETE
	config = xte 'key Delete'
	repeat = 0
end

begin
	prog = irexec
	remote = /dev/input/event1
	button = KEY_INSERT
	config = xte 'key Insert'
	repeat = 0
end
It is a problem of android kbd mapping, see next posts

Problem 2:

With _that's kernel key remapping functions, function keys (with no alt/Alt gr) and dock's special keys (with Alt/Alt Gr) are different key events, however XServer XSDL sees them as the same event, so you cannot remap them differently.
If you use function keys in your chrooted linux GUI, everithing is fine.
If you try to use dock's special keys (with Alt/Alt Gr to toggle wifi, bluetooth, adjust brightness etc.) you get the special key event AND the function key event at the same time.
So if you press Alt/AltGr+ToggleWifi you toggle wifi AND press F1 at the same time, so you may see the help window of the program you are using. And so on...
Quite annoying....

Solution
none found at the moment, I guess it would be necessary to modify XServer XSDL code.
Simply do not try use dock special keys (with Alt/AltGr) when you are inside your chrooted linux GUI

Anyway, thanks @_that!
Last edited by pinaz; 21st January 2015 at 05:27 AM.
The Following User Says Thank You to pinaz For This Useful Post: [ View ]
 
 
14th January 2015, 12:33 PM |#12  
Junior Member
Thanks Meter: 5
 
More
@_that:
I chatted with @pelya , see my comments on github:
https://github.com/pelya/commanderge...mment-69906349
it seems to be a problem of your kernel-level keyboard remapping function: it sends correct Scancodes but wrong keycodes (always 0) for "fake" ESC, DEL and INS keys (checked in android with input event logger app) see my next post

https://github.com/pelya/commanderge...mment-69908886
keycode and scancode swap for keys SLASH (Italian kbd: minus) and MINUS (IT kbd: apostrophe) may be a problem of the kernel remapping function or of CM11-CROMBI-KK, needs to be investigated
Last edited by pinaz; 20th January 2015 at 09:18 AM.
The Following 2 Users Say Thank You to pinaz For This Useful Post: [ View ]
14th January 2015, 07:42 PM |#13  
Recognized Contributor
Thanks Meter: 2,867
 
More
Quote:
Originally Posted by pinaz

@_that:
I chatted with @pelya , see my comments on github:
https://github.com/pelya/commanderge...mment-69906349
it seems to be a problem of your kernel-level keyboard remapping function: it sends correct Scancodes but wrong keycodes (always 0) for "fake" ESC, DEL and INS keys (checked in android with input event logger app)

Thanks for your research so far! The kernel sends only one set of codes, those defined in linux/input.h, through the event interface. The keycodes you're seeing come from Android and it looks like you need to copy some lines from /system/usr/keylayout/Generic.kl to asusdec.kl.
The Following 2 Users Say Thank You to _that For This Useful Post: [ View ]
20th January 2015, 09:26 AM |#14  
Junior Member
Thanks Meter: 5
 
More
Quote:
Originally Posted by _that

Thanks for your research so far! The kernel sends only one set of codes, those defined in linux/input.h, through the event interface. The keycodes you're seeing come from Android and it looks like you need to copy some lines from /system/usr/keylayout/Generic.kl to asusdec.kl.

You're right, thanks!
I solved the esc-ins-del problem in the following way
In Android terminal:
Code:
su
mount -o remount,rw /system
nano /system/usr/keylayout/asusdec.kl
then I added at the end
Code:
key 1      ESCAPE                  WAKE_DROPPED
key 110    INSERT                  WAKE_DROPPED
key 111    FORWARD_DEL             WAKE_DROPPED
then
Code:
mount -o remount,ro /system
reboot


---------- Post added at 10:26 AM ---------- Previous post was at 10:17 AM ----------

Quote:
Originally Posted by pinaz

https://github.com/pelya/commanderge...mment-69908886
keycode and scancode swap for keys SLASH (Italian kbd: minus) and MINUS (IT kbd: apostrophe) may be a problem of the kernel remapping function or of CM11-CROMBI-KK, needs to be investigated


@_that : the swap between the MINUS and SLASH keys (respectively, apostrophe and minus in Italian keyboards) seems to be a problem at the kernel level.
I looked here:
http://www.win.tue.nl/~aeb/linux/kbd...s-1.html#ss1.4

The correct scancode for US MINUS key is #0c (12) while for US SLASH key is #35 (53)
If I use @pelya 's input logger app, I get swapped scancodes (12 when I press US-SLASH/IT-minus, and 53 when I press US-MINUS/It-apostrophe, while it should be the other way round).
I did not notice it before because I was confused (in Italian kbd minus=US-SLASH, and apostrophe=US-MINUS, I saw KEY MINUS in the logger app when I was pressing It-minus and I thought it was OK, but it was not, I should see KEY SLASH instead!).
So I guess that it is something at the kernel level. @_that?

P.S. The same problem (swap of scancodes 12 and 53) happens also with an external wireless keyboard, so it is not a problem related to the asus dock kbd
Last edited by pinaz; 21st January 2015 at 05:20 AM.
20th January 2015, 08:35 PM |#15  
Recognized Contributor
Thanks Meter: 2,867
 
More
Quote:
Originally Posted by pinaz

The correct scancode for US MINUS key is #0c (12) while for US SLASH key is #35 (53)

These are exactly the codes that I get when I run evtest, which operates directly on the kernel's event interface.

The key near the right Shift key ("/" on US keyboards, "-" on my German one) sends keycode 53 (KEY_SLASH).
The key next to 0 in the top row ("-" on US keyboards, "" on my German one) sends keycode 12 (KEY_MINUS).

The same happens on my PC.
The Following User Says Thank You to _that For This Useful Post: [ View ]
20th January 2015, 08:49 PM |#16  
Junior Member
Thanks Meter: 5
 
More
Quote:
Originally Posted by _that

These are exactly the codes that I get when I run evtest, which operates directly on the kernel's event interface.

The key near the right Shift key ("/" on US keyboards, "-" on my German one) sends keycode 53 (KEY_SLASH).
The key next to 0 in the top row ("-" on US keyboards, "" on my German one) sends keycode 12 (KEY_MINUS).

The same happens on my PC.

mmm
I am not an expert in such kind of things
Do you think it is a problem of Asus hardware? Why am I getting wrong codes both on dock kbd and on external kbd?
(A simple workaround in my case is to use key remapping function in XServer XSDL, but I would like to solve the problem)
20th January 2015, 10:09 PM |#17  
Recognized Contributor
Thanks Meter: 2,867
 
More
Quote:
Originally Posted by pinaz

Do you think it is a problem of Asus hardware? Why am I getting wrong codes both on dock kbd and on external kbd?
(A simple workaround in my case is to use key remapping function in XServer XSDL, but I would like to solve the problem)

No, the hardware works fine, and the kernel works correctly too - according to your own log output you're getting the correct scancodes:

Quote:

Italian Kbd Apostrophe key: Keycode 76 KEYCODE_SLASH Scancode 12
Italan Kbd minus key: keycode 69 KEYCODE_MINUS Scancode 53

21st January 2015, 05:15 AM |#18  
Junior Member
Thanks Meter: 5
 
More
Quote:
Originally Posted by _that

No, the hardware works fine, and the kernel works correctly too - according to your own log output you're getting the correct scancodes:

You're right!
The fact that IT-MINUS corresponds to US-SLASH and not to US-MINUS was confusing me, sorry.
I repeated the tests having in mind the corresponding US keys, if I press US-MINUS I get 12, and if I press US-SLASH I get 53.
So it may be a problem of XServer XSDL.
I will check with @pelya
Thanks!
Alberto
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes