Reply
Thread Tools
Posts: 77 | Thanked: 63 times | Joined on Sep 2009
#1
In case anybody is interested, I figured out how to get bluetooth keyboards to work with the N900. I.e. how to get the pc105 xkb layout. First, copy the /usr/share/X11/xkb/ directory from chinook to the N900. (I put it in /usr/share/X11/xkb-chinook/. Be careful not to overwrite /usr/share/X11/xkb/.) Then do:

% setxkbmap -device 4 -I -I/usr/share/X11/xkb-chinook -rules base -model pc105 -layout us

It may take a little while for it to take effect. And you may need to coax it a bit by typing a bit on the internal keyboard after doing the setxkbmap. You need to redo the setxkbmap after each reboot.

So far I only tried this with the iGo Stowaway.

Jeff (http://www.ece.purdue.edu/~qobi)
 

The Following 16 Users Say Thank You to qobi For This Useful Post:
Posts: 145 | Thanked: 88 times | Joined on Nov 2009 @ Copenhagen
#2
Thanks a lot for this hint!

What is the easiest way to get a copy of the chinook /usr/share/X11/xkb/ directory (can I download it)?
 
Posts: 77 | Thanked: 63 times | Joined on Sep 2009
#3
Originally Posted by filologen View Post
What is the easiest way to get a copy of the chinook /usr/share/X11/xkb/ directory (can I download it)?
Enclosed. The versions from Diablo (which I don't have) and Debian Lenny/Squeeze/Sid might also work and might even work better. Just be careful NOT to overwrite the native /usr/share/X11/xkb/ directory on the N900 as it contains specific mods for the builtin N900 keyboard. If you do, you may brick your N900 and need to reflash. (I did.) It is also fairly tricky to merge two xkb directories together. There is an official effort to merge the N900-specific mods with the upstream full xkb-data package. See:

http://bugs.maemo.org/show_bug.cgi?id=6685

When that is complete, you should only need to do some variant of the setxkbmap command, if that.
Attached Files
File Type: tar xkb-chinook.tar (480.0 KB, 2603 views)
 

The Following 4 Users Say Thank You to qobi For This Useful Post:
Posts: 14 | Thanked: 3 times | Joined on Nov 2009
#4
I tried the above and get:

Error loading new keyboard description

Any ideas?
 
Posts: 121 | Thanked: 54 times | Joined on Oct 2007 @ New York, US
#5
I have tried it as well with the Diablo files.
Same error:

root@Nokia-N900-42-11/>setxkbmap -device 4 -I -I/usr/share/X11/xkb-diablo -rules base -model pc105 -layout us -v 10
Setting verbose level to 10etxkbmap -device 4 -I -I/usr/share/X11/xkb-diablo -rules base -model pc105 -layout us -v 10
locale is C
Warning! Multiple definitions of rules file
Using command line, ignoring X server
Warning! Multiple definitions of keyboard model
Using command line, ignoring X server
Warning! Multiple definitions of keyboard layout
Using command line, ignoring X server
Applied rules from base:
model: pc105
layout: us
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwerty)
types: complete
compat: complete
symbols: pc+us
geometry: pc(pc105)
Error loading new keyboard description
 
Posts: 145 | Thanked: 88 times | Joined on Nov 2009 @ Copenhagen
#6
Using qobi's attached archive I unfortunately also get the error message "Error loading new keyboard description" :-(

I wonder what might cause this..
 
Posts: 77 | Thanked: 63 times | Joined on Sep 2009
#7
It appears that dnastase is doing setxkbmap as root. I don't know whether filologen and mlpmail are doing it as root as well. I did it as user. And DISPLAY was bound (which it needs to be). Depending on how you get into root, DISPLAY might not be bound.

You also need to check which device id your bluetooth keyboard is connected to. You can to that with:

% hildon-im-xkbtool --list

(again as user, not root)

For me, the device is (usually) 4 but sometimes is 5 if I connect two bluetooth keyboards and then disconnect the first one. You need to modify the -device argument accordingly.
 
Posts: 77 | Thanked: 63 times | Joined on Sep 2009
#8
I suggest also trying to give the setxkbmap command the -print option. That way you will see what it resolves as the keymap and what it is trying to load as the keymap. Also try something like (again as user, not root):

% xkbcomp -i 4 :0.0 /tmp/foo.text

This reads the current keyboard map for device 4 to the file /tmp/foo.text. This is just to see that you can actually access the keyboard map. I suggest doing this before you do setxkbmap and then again after (to a different file) and checking to see that you actually installed the changes.

Two things to note once you get this to work. First, I noticed quite reliably that the new keymap doesn't take effect until you press some key on the internal keyboard. But pressing a single key will cause it to take effect. I don't know why. This makes it difficult to automate this via a script. Second, the modified keymap is lost when the bluetooth connection is dropped (and reestablished). So you need to redo the setxkbmap. I noticed over several days of use that the bluetooth connection can be dropped and reestablished sporadically, perhaps several dozen times over the course of 3-4 days. It will also drop the connection when the screen blanks, the keyboard is not used for a while, or you take a phone call. The combination of these two issues is such that when the connection is dropped and reestablished you need to rerun the setxkbmap command and then type a key on the internal keyboard. Pretty annoying, even when I have a shell script for the setxkbmap command. I'm sure there is a way to solve this but I haven't figured it out yet.
 
Posts: 14 | Thanked: 3 times | Joined on Nov 2009
#9
I was running as root in ssh. I shut off device and tried again as user from the default terminal window. This time I used -v 10 and got same result as dnatase. I have verified that my device is 4. Adding -print command shows that it is trying to use pc105 and
% xkbcomp -i 4 :0.0 /tmp/foo.text generates the keymap file without any problems.

How do I verify that DISPLAY is bound?

Earlier I compared some of the files between xkb and xkb-chinook and it appeared that the format of some of the files were different?

I am running an North-America Production model what version are you running ? Might there be some difference?

As a side note all the keys on my BT Keyboard work in DOSBox , where the device keyboard won't generate numbers.
 
Posts: 121 | Thanked: 54 times | Joined on Oct 2007 @ New York, US
#10
Originally Posted by qobi View Post
It appears that dnastase is doing setxkbmap as root. I don't know whether filologen and mlpmail are doing it as root as well. I did it as user. And DISPLAY was bound (which it needs to be). Depending on how you get into root, DISPLAY might not be bound.

You also need to check which device id your bluetooth keyboard is connected to. You can to that with:

% hildon-im-xkbtool --list

(again as user, not root)

For me, the device is (usually) 4 but sometimes is 5 if I connect two bluetooth keyboards and then disconnect the first one. You need to modify the -device argument accordingly.
I have tried both as root and as user. For both my DISPLAY is bound. I have verified that the device was indeed 4.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 10:48.