maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Accessories (https://talk.maemo.org/forumdisplay.php?f=17)
-   -   how to get bluetooth pc105 keyboards to work with N900 (https://talk.maemo.org/showthread.php?t=38372)

cardiff-blues 2010-02-12 07:37

Re: how to get bluetooth pc105 keyboards to work with N900
 
Woody..
This is the thread and you can create your own icon and use if you want.

http://talk.maemo.org/showthread.php...radio+shortcut

One problem I originally had that was causing confusion was that it didn't like me copying the code straight into a new file. The safest way to avoid this is to type out the scripts on your N900 in leafpad.

Let me know how you get on.

Ulysses 2010-02-12 18:08

Re: how to get bluetooth pc105 keyboards to work with N900
 
Now that we know how to pair and connect a bluetooth keyboard even on PR1.1 (without reflashing), has anybody managed to configure properly (with setxkbmap) an *international* keyboard (not us layout, but fr, de, be, es or pt, etc.) Please share your experience.

I'm still unsuccessful with my french apple wireless keyboard.



Ulysses

meep 2010-02-12 21:41

Re: how to get bluetooth pc105 keyboards to work with N900
 
Righto, having done some digging with xev, it seems that the n900 is picking up ctrl correctly as keycode 37...

Therefore, does anyone know if there's a way to either get ctrl to be sticky (add something into compat?) or failing that a way to press "ctrl + bksp" with a single button press (eg super key = ctrl + bksp)?

Thanks for the help

meep 2010-02-12 22:06

Re: how to get bluetooth pc105 keyboards to work with N900
 
Oki doke, in order to get around the fact that my dinovo mini will only send 1 key at once to the n900, I added the following line to usr\share\X11\xkb\compat\basic to give me sticky ctrl:

interpret Control_Lock+AnyOf(Control+Lock) {
action= LockMods(modifiers=Control+Lock)
}

I added this under the equivalent Shift_Lock {...} line.

Works a treat!

I read about how to do this here, some v. useful info:

http://www.charvolant.org/~doug/xkb/html/node5.html

Cheers

EDIT: Dagnamit, I've tried editing xkb-chinook in the same way and mapping my keyboard, it doesn't latch ctrl! (but the hw keyboard does) :(

meep 2010-02-13 00:34

Re: how to get bluetooth pc105 keyboards to work with N900
 
It seems that the rx-51 vendor specific settings under symbols is messing with how ctrl works I reckon...

any way i can make the setxkbmap command not load these settings?

cheers

brbrbrad 2010-02-13 17:15

Re: how to get bluetooth pc105 keyboards to work with N900
 
Hi all, I'm using a Logitech MX 5500 and following JoHnY's instructions, but the setxkbmap command doesn't seem to remap the BT keyboard to pc105. Any troubleshooting tips or suggestions?

shadow52 2010-02-13 20:02

Re: how to get bluetooth pc105 keyboards to work with N900
 
Hi All,

I've been following this thread for some time and as I finally took the plunge today and followed the instructions for pc105 support I thought I'd join the discussion...

Brief summary of my setup and experience in case it's useful for anyone:
I got an N900 just before Christmas and already had a Freedom Universal 2 BT keyboard. I followed the instructions to enable HID support on the N900 and was able to pair the keyboard. It's been working fine since then, but only as a larger copy of the built-in keyboard. By that I mean:

The Alt-Gr key worked as the function key. All the keys and symbols on the internal keyboard could be reproduced with the BT keyboard - tap or double/tap Shift or Alt-Gr for caps/lock or symbol/lock. With Alt-Gr pressed 'A' would give '*', 'H' would give ')' etc.

Once the device was paired there was no need to re-pair unless it was rebooted. Once the keyboard was opened, the connection light would flash briefly and it was ready to go.

Installing the new firmware over-the-air did not cause me any problems.
Since following qobi's instructions it's been working as before but now with all keys working as expected - brilliant work!

One note - the enter key doesn't work for me when the internal keyboard is closed too... but if I hit Ctrl-Enter it does. Had anyone else discovered that?

Also I'm using another BT device - a Nokia BH-103 headset. So in case the device ID changes, I'm using the Bash script below to set the keymap (need to 'apt-get install bash' for this to work). Replace 'FREEDOM' with the name of your device.


PHP Code:

#!/bin/bash
kbid=`hildon-im-xkbtool --list | grep FREEDOM`
#echo "kbid:${kbid:3:1}"
setxkbmap -device ${kbid:3:1} --I/usr/share/X11/xkb-chinook -rules base -model pc105 -layout us 

Many thanks especially to quobi and to all the contributors.

dnastase 2010-02-14 05:23

Re: how to get bluetooth pc105 keyboards to work with N900
 
Quote:

Originally Posted by shadow52 (Post 525076)
Hi All,

One note - the enter key doesn't work for me when the internal keyboard is closed too... but if I hit Ctrl-Enter it does. Had anyone else discovered that?

Yes, I've noticed this as well.
I've also noticed that actually Enter by itself, works for a little while (4-6 times) and then it stops working.

jakoleh 2010-02-14 09:00

Re: how to get bluetooth pc105 keyboards to work with N900
 
Quote:

Originally Posted by shadow52 (Post 525076)

PHP Code:

#!/bin/bash
kbid=`hildon-im-xkbtool --list | grep FREEDOM`
#echo "kbid:${kbid:3:1}"
setxkbmap -device ${kbid:3:1} --I/usr/share/X11/xkb-chinook -rules base -model pc105 -layout us 

Many thanks especially to quobi and to all the contributors.

Here is my simple python script to execute setxkbmap when keyboard connects. You can test it if it is any use for you. It is very quick and dirty version, but is working for me. Just change those values to correct ones.

Code:

import sys
# import python dbus module
import dbus
# import python dbus GLib mainloop support
import dbus.mainloop.glib
import gobject
import thread, time
import re
import commands

#hildon-im-xkbtool --list
KEYBOARDNAME = "Nokia SU-8W"
#Keyboard mac address
DEVICE = "dev_00_0E_xx_xx_xx_xx"
#setxkbmap
MODEL = "nokiasu8w"
LAYOUT = "fi"

def connected(*args, **kwargs):   
    bus = dbus.SystemBus()
    iface = dbus.Interface(bus.get_object('org.freedesktop.Notifications',
                                    '/org/freedesktop/Notifications'),
                                    'org.freedesktop.Notifications')
    if args[0] == "Connected":
        if args[1] == False:     
            iface.SystemNoteInfoprint(KEYBOARDNAME + " disconnected")
        else:
            iface.SystemNoteInfoprint(KEYBOARDNAME + " connected")
            time.sleep(2)
            testi = commands.getoutput("hildon-im-xkbtool --list") 
            #ID 3, Name: "keyboardname"
            keybId = re.search("ID (\\d+), Name: \"" + KEYBOARDNAME, str(testi)).group(1)
            commands.getoutput("setxkbmap -device " + keybId +
                        " -I -I/usr/share/X11/xkb-chinook " +
                        "-rules base -model " + MODEL +
                        " -layout " + LAYOUT)           
                           
   
def main():           
    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
    # Get the session bus
    bus = dbus.SystemBus()       
    try:     
        #Get default adapter
        manager = dbus.Interface(bus.get_object("org.bluez",
                        "/"),
                        "org.bluez.Manager")
        #dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.DefaultAdapter   
        adapter = manager.DefaultAdapter()
    # Get the remote interface for the remote object
        interface = dbus.Interface(bus.get_object('org.bluez',
                                  adapter + "/" + DEVICE),
                                  "org.bluez.Input") 
        interface.connect_to_signal("PropertyChanged", connected)             
    except dbus.DBusException:       
        sys.exit(1)   
    loop = gobject.MainLoop()   
    loop.run()
   
if __name__ == "__main__":
    main()


lwwalker 2010-02-14 14:47

Re: how to get bluetooth pc105 keyboards to work with N900
 
I'm using an SU-8W and us layout, so didn't have to change much. Works like magic, jakoleh! Running that setmap every time the keyboard reconnected was such a pain. Thank you and thanks to all the other people who have been working on this!


All times are GMT. The time now is 16:15.

vBulletin® Version 3.8.8