This question is for WiMo Standard developers. I am a Windows .NET developer willing to learn more of this platform if you guys think this is doable and relatively simple.
Do you think it's possible and would you say it's relatively easy to implement a "dormant" application (in the Windows desktop world, this would be a service or any other type of TSR application) that intercepts keystrokes (interrupts?) and sends to the OS another keystroke defined in some sort of mapping configuration?
What I'd like to have (or be able to build) is an application that will intercept a keystroke like Fn+A while typing text and type á (or Á, depending on whether I'm writing in lower or uppercases). If I don't release Fn, but press A again within a second or so, then replace that previous letter by à (or À) and then by â (or Â), etc. Just toggle through all the foreign characters that resemble the letter A (configurable through a GUI or even a configuration file) until the Fn key (or Ctrl, etc., depending on the device) is released. Most QWERTY WiMo phones do this, but not all and the Samsung BlackJack II (i617) is an example. That is really my biggest complain with this phone and I'd love to overcome it.
Keep in mind that, although this may seem like an easy task at first, there are many things to take into consideration. For example:
- The application should only work when the device is accepting text input, not when it's in the home screen, a menu, etc.
- The application should be able to handle more than one mapping per key combination.
- The application should be able to delete the previously written character if Fn was not released and the second key was pressed again and a new mapping was found (á, backspace, à, backspace, â, release Fn, done!).
- The application should be able to determine whether the next letter was supposed to be lower or uppercase and return the correct character.
- The application should become friendly with T9 if enabled (or disable itself if T9 is enabled; I personally wouldn't care, since I always disable T9).
TIA for your feedback!
Well, I am currently fooling around with my ADP1 and the one thing that bothers me the most is the fact that the keyboard isnt that well suited for me as Norwegian characters arent easily accessible (I need to hold a in order to get å, etc). I was just wondering if its possible to change what the alt-modifier chars do? (alt+k returns a " for example). I would love to have it as I have on my Touch Pro, where Fn + certain keys give me my norwegian letters
Thanks!
you can write your own key layout map by modifying existing english one.
tell me, if you are interested in and i can guide you
I might be interested in this as well... Depends on how hard it is to do!
Thanks,
Christopher
Here is the thing:
You should take qwerty.kcm file
http://android.git.kernel.org/?p=pl...b_plain;f=emulator/keymaps/qwerty.kcm;hb=HEAD
which is a text file needed to generate key layout.
This file is actually not exact from G1 keyboard, because some meta-symbols are from another key layout.
If you open it, you can find 7 columns like this:
Code:
F 'F' '3' 'f' 'F' '[' '['
The first and the second tells you what key is being considered.
Forth - what symbole would be produced, when you press the key
Fifth - the same, but with _shift_
Sixth - the same, but with _alt_
So what you need to do, is to edit certain column and add symbol you need.
For example both x and alt+x produce the same char 'x', so you can change alt+'x' on whatever you want.
The best way is to enter a Unicode code for you symbols, if they are not covered with ASCII. Based on this:
http://www.fiskeklubben.org/charcters/digitized.html
you should use 00E6 for æ. In this file it should be typed as 0x00E6
When you insert character you need and adjust some other characters, you can send this layout to me and I will generate binary file for layout, which you can use on your G1
Well, it should be easier than it seems to be.
hmm, looking at the qwerty.kcm file, it doesnt all make sense. Take x for example. Fn+x should give x, as you said.. but in the .kcm file, x is displayed like this:
X 'X' '9' 'x' 'X' '8' 0xEF00
Where the the FN-coloumn shows an 8 instead of x. Any idea why?
That is because I don't have layout file for G1.
This file is for some common android device, and fn-keys (or you can call it alt-keys) differs.
So first we need to modify it in order to match with real G1 keyboard.
There is also qwerty2.kcm file
http://android.git.kernel.org/?p=pl..._plain;f=emulator/keymaps/qwerty2.kcm;hb=HEAD
may be it is closer to real G1, but anyway does not match 100%
Ah, will take some time to edit it to match the G1. Il work on it though! What do I do with the binary layout after you're done though?
Thanks for the help
You should backup your G1 layout file and replace with new.
Ive made this one, Not 100% sure its fully correct, but it should do the trick!
I compiled it (though I have to change euro and pound symbols into unicode).
Code:
R 'R' '7' 'r' 'R' 0x00A3 0x20AC
S 'S' '7' 's' 'S' '|' 0x00DF
T 'T' '8' 't' 'T' 0x20AC 0x00A3
I tried it with emulator, seems to work fine.
The idea is: to replace /system/usr/keychars/trout-keypad-v3.kcm.bin with new file.
Here are the details:
I do not write exact instruction, hope you realize how to log into device and copy files.
Now, log to your device. Be sure you have system in rw mode.
otherwise you have to remount:
#mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
navigate to /system/usr/keychars/
#cd /system/usr/keychars/
if you type ls you can see a whole bunch of files, I recommend to backup them all.
if you have busybox installed (if you don't, you'll have to do it manually by dd if= of=)
Code:
#cd /system/usr/keychars/
#mkdir backup
#busybox cp * ./backup/
now you need to replace a file trout-keypad-v3.kcm.bin with attached
Changes should affect newly started applications and it should take some time to affect already running (other words you have to type a lot into them in order they run garbage collector and reload keylayout)
Other thing, if your phone is not US G1 your system may be using other file to read layout (not trout-keypad-v3.kcm.bin ). You can check it if you type getevent:
Code:
# getevent
add device 1: /dev/input/event4
name: "compass"
add device 2: /dev/input/event3
name: "trout-nav"
could not get driver version for /dev/input/mouse1, Not a typewriter
add device 3: /dev/input/event2
name: "trout-keypad-v3"
add device 4: /dev/input/event1
name: "synaptics-rmi-touchscreen"
could not get driver version for /dev/input/mouse0, Not a typewriter
could not get driver version for /dev/input/mice, Not a typewriter
add device 5: /dev/input/event0
name: "h2w headset"
As you can see mine using
Code:
add device 3: /dev/input/event2
name: "trout-keypad-v3"
Finally, if you'll succeed, we can write a fancy guide for other people.
WARN: if you mess up badly with layouts you probably won't be able to start telnetd from G1 keyboard and other stuff like this.
So be sure you can login to your G1 from pc with root access and revert changes. I am using JF 1.3, so I can log in via adb shell with root any time from my pc.
Thanks for the guide! I have a question regarding the qwerty file though. What about the keys on the G1's keyboard that is not in the qwerty file? Such as the @-key?
Untouchab1e said:
Thanks for the guide! I have a question regarding the qwerty file though. What about the keys on the G1's keyboard that is not in the qwerty file? Such as the @-key?
Click to expand...
Click to collapse
I don't know, what would happen if you do not map all keys (probably it will yield an error upon certain key or just give nothing), but @ is present in your layout:
Code:
AT '@' '@' '@' '@' '@' 0x2022
I have a question please.
Usualy double click on the up arrow key change the keyboard layout to full upper case, is there any way to set that the double clicking on it will change the layout to other language and not upper case?
I understood that there is a difficult with changing the layout, maybe that may be a nice solution at least for some of us.
zrubi
I don't think there is a strait forward way to do it by now.
But soon (Feb 2009 I think) T-Mobile will introduce G1 to some European countries other then GB, so Google have to develope some easy way to change layouts by this time.
worry said:
zrubi
I don't think there is a strait forward way to do it by now.
But soon (Feb 2009 I think) T-Mobile will introduce G1 to some European countries other then GB, so Google have to develope some easy way to change layouts by this time.
Click to expand...
Click to collapse
Hi!
worry, first of all, thank you for all your research and work on keyboard layout. I've been following your research here and on russian forums.
I've also investigated this topic a bit and found the following following property described at http://www.kandroid.org/android_pdk/keymaps_keyboard_input.html as the one which would allow to switch the layout dynamically without kcm file substitution, but unfortunately it does NOT work.
setprop android.keychar.trout-keypad-v3 /system/usr/keychars/qwerty_ru.kcm.bin
Do you have any new information on this topic?
Do you happen to know how French and German keyboard layout switch is implemented (if there is any switching at all)?
Thank you!
i wanna change my @ button to a /
This is incredible! One step closer to be able to switch keyboard layouts on G1.
Thank you, guys!
How can I change the characters which's showed when I hold a char on keyboard ? (for an example : hold "A" and see)
And how can I creat a new type rule ? For an example I type double "A" an it become "Â", and if type triple "A" , it will return "AAA" and creat an option to on/off this feature ?
worry said:
...you can send this layout to me and I will generate binary file for layout, which you can use on your G1
Click to expand...
Click to collapse
So how exactly does one generate the binary file? I'm eager to know so I wouldn't need to ask people to do that for me when trying out layouts
Does anyone have the .kcm (not .kcm.bin) file for US G1 or ADP? (I guess it's trout-keypad-v3.kcm) or know where I can find it?
/Mats
I've been running kexecboot native Linux for a while now and this has been a side project of mine since bumping into Linux Deploy. I really wanted to run my Linux and have my Android too... So, I got tired of trying to get Linux to run on the Android frambuffer and went this route... This runs pretty fast on my tablet. Resources seem way lower than a vnc chroot. And running on an xserver has more advantages. This is only tested so far with an image file and LXDE (I will be trying a microsd directory install soon).
XFCE4 and microsd partition install running fine also.
Use gparted to partition your microsd.
I used a SanDisk Class 10 16gb UH-I (8.5mb/s write and 24.5mb/s read) partitioned to 12gb fat32, 4gb ext4
These are just the settings I used that worked first for me. Play around, you can't hurt anything...
Download/Install:
Linux Deploy, Xserver XSDL and Connectbot
Setup Linux Deploy:
-Goto settings update environment
-On main screen click the install icon (it is the little down arrow)
---Under Deploy:
-Select your distro
-Architecture - arm7hf
-Installation type - File or ext4 partition
-Installation Path - change path and or file name or microsd partition (ex /dev/block/mmcblk1p2 for 2nd partition on microsd)
-Image size - at least 2GB (default is 4GB)
-User name - pick one or leave it
-Select components - check all
-Desktop environment - LXDE
---Under Startup:
-Check ssh server and Custom mount points
---Under Action:
-Go back to the top and select install.
-After it finishes click Start
Setup Xserver XSDL:
-Home button out and start Xserver XSDL
-Click screen immediately and choose 1900x1136(native) and font 0.5
-For those without a dock you may need to click "Change device configuration" at the top
when it first starts
Setup Connectbot:
-Home button out and start Connectbot
-ssh: [email protected]
-password: changes
-export DISPLAY=:0
-startlxde
-Recent apps select Xserver XSDL
**Profit**
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
XSDL works fine with my symlinked Arch.
Running super fast from an ext4 partition on my sdcard...
sound?
workdowg said:
Running super fast from an ext4 partition on my sdcard...
Click to expand...
Click to collapse
Did you manage to make sound work?
I tried to install alsa, audio devices are present but do not work...
pinaz said:
Did you manage to make sound work?
I tried to install alsa, audio devices are present but do not work...
Click to expand...
Click to collapse
No... @_that may have.
workdowg said:
No... @_that may have.
Click to expand...
Click to collapse
No, I only tried apps like Gimp and LibreOffice.
Linux Deploy update
With the latest version of Linux Deploy, Connect Bot is not needed any more.
Just select the option "GUI - Allow startup graphical environment", on "Graphics Subsystem" select "X Window System", and then on "GUI Settings" set "Display" to 0 and "X Server Address" to localhost
Now first start XServer XSDL and then start the Linux Deploy service
BTW, I am trying XFCE desktop on Ubuntu Precise, it is really fast.
A good idea (if you use ubuntu and xfce) may be to install the package xubuntu-desktop (Linux Deploy makes a very basic installation of XFCE, even icons are completely missing!)
PROBLEMS WITH KEYBOARD LAYOUTS OTHER THAN "US" - SOLUTIONS
I have a dock with Italian keyboard and I had some problems, probably due to some XServer XSDL bugs.
I set "it" keyboard layout in XFCE settings, all keys are working correctly apart from two things (only using XServer XSDL, with other android apps I have no problem with the keyboard):
1) Keys " ' ? " and " - _ " are swapped
Solution:
edit /usr/share/X11/xkb/symbols/it and swap AE11 and AB10 codes in the "basic" section, in this way:
Code:
partial default alphanumeric_keys
xkb_symbols "basic" {
include "latin(type4)"
name[Group1]="Italian";
.........
key <[COLOR="Red"]AB10[/COLOR]> { [apostrophe, question, grave, questiondown ] };
.........
key <[COLOR="Red"]AE11[/COLOR]> { [ minus, underscore, dead_macron, division ] };
.........
include "level3(ralt_switch)"
};
I checked with Input event logger app, the problem is probably due to a bug in dock keyboard remapping by Android (I use CROMBI-KK with _that kernel, I do not know what part causes the problem)
The simpler workaround is to manually remap the keys in XServer XSDL: the Italian keyboard's "minus" key shoud be remapped to "SLASH" and Italian "apostrophe" to "MINUS" (in fact US-minus corresponds to IT-apostrophe, and US-slash to IT-minus)
2) the 102nd key is not working at all. ( It is the key at the right of the left-SHIFT key, that in the Italian keyboard layout corresponds to the " < > " key)
It is a problem of XServer XSDL, because if I check key press events in X with the following command:
Code:
xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
all keys work except for the 102nd key, while if I check key press events from the input device, in this way:
Code:
evtest /dev/input/event1
the 102nd key works.
Solution:
We need a little workaround, because it seems that XServer XSDL does not "see" the 102nd key at all.
First, install some stuff
Code:
sudo apt-get install inputlirc lirc input-tools xautomation
Then create a file .lircrc in your home directory with the following content:
Code:
begin
prog = irexec
remote = /dev/input/event1
button = KEY_102ND
config = xte 'str <'
repeat = 0
end
begin
prog = irexec
remote = /dev/input/event1
button = SHIFT_KEY_102ND
config = xte 'str >'
repeat = 0
end
then execute the following commands
Code:
sudo inputlircd -c -m 0 /dev/input/event1
irexec -d
You may put the above code in a script that starts automatically with the X session (in XFCE, see Applications Menu->Settings->Sessions and Startup)
Note that the "irexec -d" part must be executed from within the X session by the X session user, so you cannot use a Custom Script in Linux Deploy (which executes commands as root outside the X session)
So it is simpler to use an autostart script within XFCE
Hope that this may help also other people, in fact XServer XSDL officially supports only US Keyboards, so I guess that also keyboard layouts other than the Italian one may be affected
Cheers, and happy 2015!
EDIT:
It is definitively an XServer XSDL bug. I tried to connect a wireless Italian keyboard and I got the same problems as with the asus dock keyboards (apostrophe and minus keys swapped, 102nd key not working)
Custom mount points
(I use CROMBI_KK, but I guess the following applies also to other ROMs)
To access internal and external sdcards, usbdisks etc with read-write permission one has to correctly set custom mount points in Linux Deploy. I was using /storage/sdcard0, /storage/sdcard1 but it is not correct, you get only read permissions with normal user (rw only with root).
The right mount points are (in CROMBI_KK)
/data/media/0 (for internal SD)
/mnt/media_rw/sdcard1 (for external MicroSD)
/mnt/media_rw/sdcard2 (for external SD in dock)
/mnt/media_rw/usbdisk0 (for Usb disk in dock)
In other ROMs mount point may change, you can check with a mount command from terminal within android (avoid fuse mounts and search for "real" mounts)
LITTLE TRICK:
When you start Linux Deploy service, it can only mount already mounted sdcards and usbdisks, if you insert a new sdcard after having started Linux Deploy, you cannot see it automatically from Linux.
However, you just have to click again on "Start" in Linux Deploy, it will skip already started services and mount only the missing sdcard(s) or usbdisk
keyboard dock
_that said:
No, I only tried apps like Gimp and LibreOffice.
Click to expand...
Click to collapse
See my previous posts, I have almost managed to configure everything for office use (including printing, excluding sound...), I am quite satisfied because it is reasonably fast and usable, but one important part is missing: esc, del and function keys.
XServer XSDL can remap them but it does not help much: it seems that the following keys are not intercepted normally but seem to be handled specially by CM 11/CROMBI KK:
TOGGLE_(WIFI, BT, TOUCHPAD) , BRIGHTNESS_(UP, DOWN, AUTO), CAMERA, EXPLORER, SETTINGS, POWER
So even with remapping, when I try to press the key corresponding to F1, I get an F1 event on the chrooted linux but also a toggle-wifi event on Android, when I press F2 I get F2 on linux and toggle-bluetooth on android, and so on...
Even using shift/ctrl/alt/fn+ dock special keys, CM11/CROMBI-KK intercepts them as if no shift/ctrl/alt/fn is used.
Other people experienced the same problem, see here:
http://forum.cyanogenmod.org/topic/83065-how-to-re-map-keyboard-dock-layout-for-custom-keymap/
I guess I have to stop some service in CM11/CROMBI KK that handles special keys, any idea about which one I have to kill? @_that?
pinaz said:
but one important part is missing: esc, del and function keys.
Click to expand...
Click to collapse
Try playing with the kernel level function key remapping that I added in my kernel:
http://forum.xda-developers.com/showpost.php?p=40168242&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.
_that said:
Try playing with the kernel level function key remapping that I added in my kernel:
http://forum.xda-developers.com/showpost.php?p=40168242&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.
Click to expand...
Click to collapse
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!
@_that:
I chatted with @pelya , see my comments on github:
https://github.com/pelya/commandergenius/issues/40#issuecomment-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/commandergenius/issues/40#issuecomment-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
pinaz said:
@_that:
I chatted with @pelya , see my comments on github:
https://github.com/pelya/commandergenius/issues/40#issuecomment-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)
Click to expand...
Click to collapse
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.
_that said:
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.
Click to expand...
Click to collapse
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 ----------
pinaz said:
https://github.com/pelya/commandergenius/issues/40#issuecomment-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
Click to expand...
Click to collapse
@_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/scancodes-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
pinaz said:
The correct scancode for US MINUS key is #0c (12) while for US SLASH key is #35 (53)
Click to expand...
Click to collapse
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.
_that said:
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.
Click to expand...
Click to collapse
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)
pinaz said:
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)
Click to expand...
Click to collapse
No, the hardware works fine, and the kernel works correctly too - according to your own log output you're getting the correct scancodes:
Italian Kbd Apostrophe key: Keycode 76 KEYCODE_SLASH Scancode 12
Italan Kbd minus key: keycode 69 KEYCODE_MINUS Scancode 53
Click to expand...
Click to collapse
_that said:
No, the hardware works fine, and the kernel works correctly too - according to your own log output you're getting the correct scancodes:
Click to expand...
Click to collapse
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
I have Samsung S10 with Android 12
When I connect bluetooth gamepad, it gets recognized as "Physical keyboard" (gamepad is VR BOX)
When I enter in SCUMMVM (gaming app), it has a hud on screen shortcut key (HUD)to call a onscreen keyboard (needed in some games). If a bluetooth gamepad is connected, the shortcut key doesn't work and I can't call the onscreen keyboard. Under "Physical keyboard" options I have turned on "show on-screen keyboard" but it didn't help.
I've read that in past people had simmilar problems with other gamepads on older andorid phones and that the solution was to go to Android settings and "select your default keyboard. (physical or virtual)" but I don't have that option.
Any idea how to solve this problem?
The root problem is that the USB HID report descriptors in your little handheld are written incorrectly.
It's reporting that it can send the alphabet (specifically "Q").
Me? I'd fix the problem by reverse engineering the device.
The next possibility is to use a custom /system/usr/idc/Vendor...idc to make it clear that this is not a qwerty
The last possibility (and the one you probably want) is in Settings > System > Languages & input > Physical keyboard > Keyboard assistance > Show virtual keyboard.
You can load my UsbMode.apk (in the sig) and see that your handheld is identified as a qwerty.
Renate said:
The root problem is that the USB HID report descriptors in your little handheld are written incorrectly.
It's reporting that it can send the alphabet (specifically "Q").
Me? I'd fix the problem by reverse engineering the device.
The next possibility is to use a custom /system/usr/idc/Vendor...idc to make it clear that this is not a qwerty
The last possibility (and the one you probably want) is in Settings > System > Languages & input > Physical keyboard > Keyboard assistance > Show virtual keyboard.
You can load my UsbMode.apk (in the sig) and see that your handheld is identified as a qwerty.
Click to expand...
Click to collapse
Thanks for your answer
As I've mentioned before "Show virtual keyboard" doesn't work. I can see the on screen button that would call the virtual keyboard but it doesn't work if the gamepad is connected
I'm interested in solution to use custom Vendor.idc or to reverse engineer the device but I'm a noob to do it myself. I've went to /system/usr/idc/ dir and can see 4 .idc files where in the files, it says that two are form "Sony DS4...", and two are for "Google Reference RCU Remote" - none seams that belongs to the "no name" gamepad device I'm using? There are bunch of other .idc files but also no one seams to belong to the device...
Here's the paste from the Google RCU device:
1st file:
# Input Device Configuration file for Google Reference RCU Remote.
#
# Basic Parameters
# Due to a memory error on early prototypes of the reference remote control
# the VID/PID is mapped to 248a/8266 instead of 0957/0001
keyboard.layout = Vendor_0957_Product_0001
keyboard.doNotWakeByDefault = 1
audio.mic = 1
2nd file:
# Input Device Configuration file for Google Reference RCU Remote.
#
# Basic Parameters
keyboard.layout = Vendor_0957_Product_0001
keyboard.doNotWakeByDefault = 1
audio.mic = 1
Any help?
This gamepad I'm trying to use is pretty neat to play games by one hand which is great on mobile as you can hold device in one hand and gamepad in other so it would be great to hack it if to also be able to show keyboard on keypress demand if it is possible
Try the UsbMode.apk. Also, does a little boxed "A" appear on the status bar when the remote is active?
First, with the remote active, identify the VID/PID of your device
Code:
$ logcat|grep btif
bt_btif : bta_hh_co_send_hid_info: vendor_id = 0x291a, product_id = 0x8502, // something like this
^C
Could you do me a favor (just for my own interest)?
Code:
$ cd /sys/bus/hid/devices
$ cd whatever // there's only one directory here, named ????:VID#:PID#:????
$ cp report_descriptor /sdcard/descript.img
$ ^D
C:\>adb pull /sdcard/descript.img
Hmm, it looks like there is no option in idc. You'll have to make a keylayout file.
Please use the UsbMode.apk and write down what all the buttons do.
There's not that many. I just need the Android names, you don't need to say which button on the remote it is.