Reply
Thread Tools
Posts: 9 | Thanked: 0 times | Joined on Jan 2006
#21
Hey qobi,

Thanks for jumping back on the thread!

Originally Posted by qobi View Post
It may help figuring out what is going on if you can report what the variations on the setxkbmap command are and what variations on the error result.
Fair enough.

Code:
~/MyDocs/bin/bluetooth_keyboard $ whoami
user

~/MyDocs/bin/bluetooth_keyboard $ echo $DISPLAY
:0.0

~/MyDocs/bin/bluetooth_keyboard $ hildon-im-xkbtool --list
ID 0, Name: "Virtual core pointer"
ID 1, Name: "Virtual core keyboard"
ID 2, Name: "TSC2005 touchscreen"
ID 3, Name: "omap_twl4030keypad"
ID 4, Name: "00:1D:82:02:7D:45"
ID 5, Name: "Think Outside Keyboard"

~/MyDocs/bin/bluetooth_keyboard $ xkbcomp -i 5 :0.0 keymap-before.txt

~/MyDocs/bin/bluetooth_keyboard $ hildon-im-xkbtool -g
Internal keyboard:
Model: nokiarx51
Layout: us
Delay: 600
Interval: 50

External keyboard:
Model: nokiasu8w
Layout: us
Delay: 600
Interval: 50

~/MyDocs/bin/bluetooth_keyboard $ ls -la /usr/share/X11/xkb-chinook/
drwxr-xr-x    9 root     root         1064 Jan 10 17:59 .
drwxr-xr-x    5 root     root          504 Jan  5 11:19 ..
drwxr-xr-x    2 root     root         1144 Jan  5 11:19 compat
-rw-r--r--    1 root     root          841 Oct 10  2007 compat.dir
drwxr-xr-x    2 root     root          224 Jan  5 11:19 geometry
-rw-r--r--    1 root     root          168 Oct 10  2007 geometry.dir
drwxr-xr-x    2 root     root          416 Jan  5 11:19 keycodes
-rw-r--r--    1 root     root          298 Oct 10  2007 keycodes.dir
drwxr-xr-x    2 root     root          704 Jan  5 11:19 rules
drwxr-xr-x    2 root     root          360 Jan  5 11:19 semantics
-rw-r--r--    1 root     root          103 Oct 10  2007 semantics.dir
drwxr-xr-x    3 root     root         2424 Jan  5 11:19 symbols
-rw-r--r--    1 root     root         5544 Oct 10  2007 symbols.dir
drwxr-xr-x    2 root     root          944 Jan  5 11:19 types
-rw-r--r--    1 root     root          624 Oct 10  2007 types.dir

~/MyDocs/bin/bluetooth_keyboard $ setxkbmap -v 10 -device 5 -I -I/usr/share/X11/xkb-chinook -rules base -model pc105 -layout us
Setting verbose level to 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

<Pressed a few keys on the internal keyboard...>

~/MyDocs/bin/bluetooth_keyboard $ xkbcomp -i 5 :0.0 keymap-after.txt

$ diff keymap-before.txt keymap-after.txt

~/MyDocs/bin/bluetooth_keyboard $ hildon-im-xkbtool -g
Internal keyboard:
Model: nokiarx51
Layout: us
Delay: 600
Interval: 50

External keyboard:
Model: nokiasu8w
Layout: us
Delay: 600
Interval: 50

~/MyDocs/bin/bluetooth_keyboard $
Your explanation of the '-I' thing definitely clarifies the errors I was seeing from variations on this setxkbmap command. Any thoughts on how we can dig into that "Error loading new keyboard description" to find out what's going on?

Thanks.
 
Posts: 77 | Thanked: 63 times | Joined on Sep 2009
#22
I have the same keyboard as you. Here is the output of xkbcomp before and after I issue setxkbmap.
Attached Files
File Type: gz before.txt.gz (5.7 KB, 301 views)
File Type: gz after.txt.gz (5.9 KB, 347 views)
 
Posts: 77 | Thanked: 63 times | Joined on Sep 2009
#23
I should also point out that I get the same output as you for hildon-im-xkbtool -g bot before and after. the setxkbmap.
 
Posts: 77 | Thanked: 63 times | Joined on Sep 2009
#24
Enclosed is the strace output when I successfully run setxkbmap.
A diff against yours might help figure out what is going on.
One thing I noticed is that I have two symlinks in /usr/share/X11/xkb-chinook:

compiled -> /var/lib/xkb
xkbcomp -> ../../../bin/xkbcomp

At this point I don't recall whether they were created automatically or whether I created them manually when I setup the directory because I saw similar symlinks in the native /usr/share/X11/xkb on the N900. But the ctimes and mtimes indicate that they were created the same day as my original post to this thread which indicates that they may be related. But I'm not sure because strace doesn't show them being accessed.
Attached Files
File Type: txt strace.txt (8.4 KB, 346 views)
 
Posts: 77 | Thanked: 63 times | Joined on Sep 2009
#25
Another idea. I tried lots of things before I got it to work. And I don't remember precisely what they all were. And some of those may have laid the groundwork, i.e. changed the state of something which eventually allowed the setxkbmap command to work reliably.

One of those things was piping through xkbcomp. The man page for setxkbmap (on Lenny) states:

USING WITH xkbcomp
If you have an Xserver and a client shell running on different comput-
ers and XKB configuration files on those machines are different you can
get problems specifying a keyboard map by model, layout, options names.
This is because setxkbcomp converts these names to names of XKB config-
uration files according to files that are on the client side computer,
then it sends the file names to the server where the xkbcomp has to
compose a complete keyboard map using files which the server has. Thus
if the sets of files differ significantly the names that the setxkbmap
generates can be unacceptable on the server side. You can solve this
problem by running the xkbcomp on the client side too. With the -print
option setxkbmap just prints the file names in an appropriate format to
its stdout and this output can be piped directly to the xkbcomp input.
For example, the command

setxkbmap us -print | xkbcomp - $DISPLAY

makes both steps run on the same (client) machine and loads a keyboard
map into the server.

I probably gave the full set of args to setxkbmap (except for device) and then specified the device to xkbcomp. The man page (on Lenny) for xkbcomp doesn't mention the -i device option but if you run xkbcomp -help you see that it accepts such.
 
Posts: 77 | Thanked: 63 times | Joined on Sep 2009
#26
Can someone try the following to help diagnose this. Install /usr/share/X11/xkb-chinook (from my earlier post) and create the symlinks as per my earlier post. Then try

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

where the device is appropriate for your machine (run hildon-im-xkbtool --list to find out). Let me know if that works. If it doesn't can you try:

setxkbmap -I -I/usr/share/X11/xkb-chinook -rules base -model pc105 -layout us -print|xkbcomp -i 4 - $DISPLAY

where again, you first setup the symlinks as per my earlier post and also change -i 4 to the appropriate device. Let me know if that works.

And if someone can post the an strace of when it doesn't work and compare it against the working strace that I posted, that would also help diagnose this.

If neither of these work, I have an idea of what it could be.
 
Posts: 77 | Thanked: 63 times | Joined on Sep 2009
#27
I figured out why other people were not able to replicate my ability to get bluetooth keyboards to work. It was due to residue from some of my early attempts. This post outlines what I believe should work for everyone.

First, let me emphasize that you should not attempt to do this unless you know what you are doing. If you make a mistake and mess up the /usr/share/X11/xkb directory you will brick your device and need to reflash. I know because I did.

This assumes that you have already enabled HID bluetooth by editing /etc/bluetooth/main.conf as described elsewhere. And that you hae already installed /usr/share/X11/xkb-chinook from the tar file that I posted earlier in this thread.

As root do:
# cd /usr/share/X11
# cp -i xkb-chinook/symbols/pc xkb/symbols/.
# cp -i xkb-chinook/symbols/us xkb/symbols/.
# cp -i xkb-chinook/geometry/pc xkb/geometry/.

Make sure that in the above you give cp the -i option and that you do not overwrite any files in /usr/share/X11/xkb/

Then as user do:
$ setxkbmap -device 4 -I -I/usr/share/X11/xkb-chinook -rules base -model pc105 -layout us
Then type a key (any key) on the internal keyboard. Now the external keyboard should work.

I don't know why you need to type a key on the internal keyboard for this to take effect.

The above assume that the keyboard is connected to device 4 which is what usually happens. But you should check first as described earlier in this thread.

You will need to reissue the setxkbmap command (as user) and type a key on the internal keyboard each time you connect the bluetooth keyboard. I find that periodically, the bluetooth connection to the keyboard is dropped and reinitialized. I don't know why this happens. But when it does you need to reissue the setxkbmap command and type a key on the internal keyboard. So I find it useful to have a shell script for it.

If someone else gets this to work, I'd appreciate hearing about it.
 

The Following 12 Users Say Thank You to qobi For This Useful Post:
Posts: 739 | Thanked: 220 times | Joined on Dec 2009 @ Surrey, UK
#28
Should this method work for the igo stowaway?
__________________
There is a way that seems right to a man, but in the end it leads to death. Proverbs 14:12
 
Posts: 77 | Thanked: 63 times | Joined on Sep 2009
#29
Originally Posted by cardiff-blues View Post
Should this method work for the igo stowaway?
Yes, that is what I am using.
 

The Following User Says Thank You to qobi For This Useful Post:
Posts: 739 | Thanked: 220 times | Joined on Dec 2009 @ Surrey, UK
#30
OK Thanks qobi. I will have a go at this. I'm a windows user so I may have to ask some easy questions as I try.
__________________
There is a way that seems right to a man, but in the end it leads to death. Proverbs 14:12
 
Reply


 
Forum Jump


All times are GMT. The time now is 21:51.