Reply
Thread Tools
Posts: 1 | Thanked: 0 times | Joined on May 2010 @ Denmark
#271
Originally Posted by jakoleh View Post
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()

Hi,

I know Python quiet well, but not the Maeomo specific stuff. The script is setting the layout every time the keyboard connects, but how is the script invoked the first time, to make the MainLoop run at all times?
 
Posts: 5 | Thanked: 0 times | Joined on Mar 2010
#272
Hello guys,

I followed this wiki to connect my Apple Wireless Keyboard.

http://wiki.maemo.org/Fremantle_Blue...eyboard_Layout

It works fine so far, but I have to issues:

1) Is there a working German layout within xkb-chinook?
If I just use
HTML Code:
"cp -i xkb-chinook/symbols/de xkb/symbols/."
and
Code:
setxkbmap -device 4 -I -I/usr/share/X11/xkb-chinook -rules base -model pc105 -layout de
it does not work (I do have ü, ä, ö but on arrow keys )


2) I do not understand the last part of the wiki article.
What does "Put this in /etc/init.d/bluetooth-keyboard" mean?
Is that folder/file and how do I edit/create it?!


Thank you very much for your support!!
 
Posts: 692 | Thanked: 264 times | Joined on Dec 2009
#273
Hey couple of quick questions.

Today I hooked up a Rocketfish bluetooth keyboard (model RF-BTKB2) to the N900, got the layout set up and was playing Descent on the TV, had no problems setting it up. But I ran into a couple of issues:

1. If the phone is in sleep mode (screen off) the bluetooth keyboard doesn't work. Any workarounds for this?

2. After disconnecting the keyboard, the N900's Ctrl key wouldn't work and it was stuck in caps lock mode. I had to reboot to get it back to normal. Is there a command that will reset the keyboard?

Thanks
__________________
"Impossible is not in the Maemo vocabulary" - Caballero

Last edited by GameboyRMH; 2010-05-18 at 12:54.
 
Posts: 561 | Thanked: 75 times | Joined on Jan 2010 @ Spain
#274
Originally Posted by superbelow View Post
Hello guys,

I followed this wiki to connect my Apple Wireless Keyboard.

http://wiki.maemo.org/Fremantle_Blue...eyboard_Layout

It works fine so far, but I have to issues:

1) Is there a working German layout within xkb-chinook?
If I just use
HTML Code:
"cp -i xkb-chinook/symbols/de xkb/symbols/."
and
Code:
setxkbmap -device 4 -I -I/usr/share/X11/xkb-chinook -rules base -model pc105 -layout de
it does not work (I do have ü, ä, ö but on arrow keys )


2) I do not understand the last part of the wiki article.
What does "Put this in /etc/init.d/bluetooth-keyboard" mean?
Is that folder/file and how do I edit/create it?!


Thank you very much for your support!!
I have the same problem with the Spanish language
 
Posts: 77 | Thanked: 63 times | Joined on Sep 2009
#275
Has anybody tried the bluetooth keyboard methods from this thread with PR1.2? Known to work? Known not to work?
 
Posts: 692 | Thanked: 264 times | Joined on Dec 2009
#276
I don't see any reason this shouldn't work just the same.
__________________
"Impossible is not in the Maemo vocabulary" - Caballero
 
Posts: 45 | Thanked: 36 times | Joined on Jan 2010
#277
Originally Posted by qobi View Post
Has anybody tried the bluetooth keyboard methods from this thread with PR1.2? Known to work? Known not to work?
Hi,

yes, I can confirm the steps I have previously got together are still working, even after reflashing the device with the new firmware.

JoHnY
 
Posts: 121 | Thanked: 54 times | Joined on Oct 2007 @ New York, US
#278
Originally Posted by JoHnY View Post
Hi,

yes, I can confirm the steps I have previously got together are still working, even after reflashing the device with the new firmware.

JoHnY
So this issue hasn't been fixed by PR 1.2 ?
 
Posts: 45 | Thanked: 36 times | Joined on Jan 2010
#279
Originally Posted by dnastase View Post
So this issue hasn't been fixed by PR 1.2 ?
Yes, it does not work out of the box... Although I did not have to send the dbus command and the keyboard did connect succesfully instantly (after removing the input from the disabled plugins for bluetooth) and I only had to set the new keyboard layout, but it's probably just due to the fact that I have been using it previously.
 
Posts: 11 | Thanked: 1 time | Joined on Apr 2008
#280
Originally Posted by qobi View Post
Has anybody tried the bluetooth keyboard methods from this thread with PR1.2? Known to work? Known not to work?
Yes: NO they do not work for me. Just before installing PR1.2 I was ecstatic to get my iGo Ultra Slim Stowaway working beautifully, with the exception of the return key periodically quitting. On re-executing the setxkbmap command and pressing yet again a key on the N900, it would come back.
After installing PR1.2, the N900 doesn't hear the iGo. Nothing at all. If I delete it and re-pair, it says it pairs successfully, but no keystrokes get to the N900, nor does it appear in the hildon-im-xkbtool --list. It's dead in the water.
I've stopped and restarted bluetoothd, also.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 06:28.