| 1   2   | Next
maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   N900 keyboard friendly (https://talk.maemo.org/showthread.php?t=38314)

Matan 2009-12-24 15:32

N900 keyboard friendly
 
*** A lot of information in this thread in now obsolete. Please read this thread instead.

I prefer touching the screen as little as possible, and I also notice that a lot of actions (such as launching a frequently launched application) can be done much quicker using the keyboard. Therefore, I work on making the N900 more keyboard friendly:

To be able to launch applications using hot keys you need to replace hildon-desktop with one that better support keyboard actions: run as root something like this

Code:

cd /root
wget http://my.arava.co.il/~matan/770/n900/kf/hildon-desktop
chmod a+x hildon-desktop
mv /usr/bin/hildon-desktop.launch /usr/bin/hildon-desktop.launch.org
mv hildon-desktop /usr/bin/hildon-desktop.launch

After a reboot the new hildon-desktop will run which has two changes: an added hot key: <shift><ctrl>H takes you to home screen. Any other <shift><ctrl>letter is advertised on the D-bus.

On option for intercepting the dbus messages and using them to launch applications is with dbus-scripts:

Install dbus-scripts (from extras-devel).
Copy the file http://my.arava.co.il/~matan/770/n900/kf/hdk-scripts to /etc/dbus-scripts.d and the file http://my.arava.co.il/~matan/770/n900/kf/hdk to /usr/local/bin (making sure it is executable).

After this, <shift><ctrl>f launches FBreader, <shift><ctrl>b opens a new browser window, and a few other shortcuts. Currently configuring shortcuts is by editing the python script /usr/local/bin/hdk.

I intend to continue working on hildon-desktop, making it possible to switch desktops and windows by keyboard.

jebba 2009-12-24 18:09

Re: N900 keyboard friendly
 
Very cool.

Can you please post the source code?

I was kludging up something similar using xbindkeys.

Thanks,

-Jeff
http://wiki.maemo.org/User:Jebba

Matan 2009-12-24 18:13

Re: N900 keyboard friendly
 
The three files that I changed in hildon-desktop source package are there:

http://my.arava.co.il/~matan/770/n900/kf/

jebba 2009-12-24 18:24

Re: N900 keyboard friendly
 
Quote:

Originally Posted by Matan (Post 440603)
The three files that I changed in hildon-desktop source package are there:

http://my.arava.co.il/~matan/770/n900/kf/

Ah, ok i get it thanks!

-Jeff

Matan 2009-12-27 21:46

Re: N900 keyboard friendly
 
Current code is at http://my.arava.co.il/~matan/770/n900/kf/ (binary: hildon-desktop2, diff: hd2.diff, shortcuts file: hdk2). This now allows:
ctrl-shift-h go to desktop, ctrl-shift-l go to application launcher, and left/right arrows working in desktop (to switch desktops).

I hope other people would like to join this project.
Assistance I'd like to have:

1. If anyone can look at my code and tell me why hildon_desktop_activate() does not work as expected, please do.

2. If anyone has ideas on how to make hildon-desktop (home screen, window switcher, application launcher) more keyboard friendly, please share them.

3. Start identifying applications which can be improved (either at source level or at configuration level).

DaSilva 2009-12-27 21:55

Re: N900 keyboard friendly
 
Have you released the patches / changes to the official Hildon GIT? Maybe it will be integrated in one of the next updates...

fpp 2009-12-27 21:56

Re: N900 keyboard friendly
 
Is there a secret art for keying in Ctrl+Shift combinations simply and quickly ? I also prefer using the keyboard, and I don't have big fingers, but in the time it takes me to successfully type, say, ctrl-shift-x, I can tap the screen all it takes to get to the xterm icon, several times :-)

Matan 2009-12-27 22:01

Re: N900 keyboard friendly
 
I exchanged the Fn and shift keys. Again, I am open to better ideas.

About including the changes in upstream - where is the upstream maintained?

jebba 2009-12-27 23:03

Re: N900 keyboard friendly
 
Quote:

Originally Posted by Matan (Post 443271)
About including the changes in upstream - where is the upstream maintained?

http://maemo.gitorious.org/
http://maemo.gitorious.org/fremantle-hildon-desktop
http://maemo.gitorious.org/fremantle...hildon-desktop

Tons there--I think that last one is what you want, but didn't confirm it.

-Jeff

P.S. Thx for fixes @ my wiki page.
http://wiki.maemo.org/User:Jebba

fpp 2009-12-28 17:52

Re: N900 keyboard friendly
 
Quote:

Originally Posted by Matan (Post 443271)
I exchanged the Fn and shift keys. Again, I am open to better ideas.

Ah, I'd missed that, sorry. Certainly makes the idea a whole lot more attractive ! :-)

iKneaDough 2009-12-31 14:12

Re: N900 keyboard friendly
 
Quote:

Originally Posted by Matan (Post 443271)
I exchanged the Fn and shift keys. Again, I am open to better ideas.

Can you please detail how to swap the Fn and Shift keys?

Matan 2009-12-31 14:21

Re: N900 keyboard friendly
 
Edit the file /usr/share/X11/xkb/symbols/nokia_vndr/rx-51

find:

Code:

    key <LFSH>  {
        type[Group1] = "ONE_LEVEL",
        symbols[Group1] = [    Shift_L ]
    };
    modifier_map Shift { Shift_L };

Replace LFSH with RALT. This makes FN behave like shift.

Then find
Code:

include "level3(ralt_switch)"
remove this line, and replace it with:
Code:

key <LFSH> {
    type[Group1]="ONE_LEVEL",
    symbols[Group1] = [ ISO_Level3_Shift ]
    };
  modifier_map Mod5  { ISO_Level3_Shift };

This makes the shift key behave as FN.

After editing rx-51, use the command setxkbmap to activate it.

iKneaDough 2009-12-31 14:48

Re: N900 keyboard friendly
 
Thanks Matan!

I was already using your modified keyboard from here.

In your modified file I'm assuming the code to switch input methods using Fn + VolumeKeys is from this part:
Code:

key <FK07>        { [        F8,        F8,        ISO_Level5_Lock, ISO_Level5_Lock        ] };
    key <FK08>        { [        F7,        F7,        ISO_Level5_Lock, Iso_Level5_Lock        ] };

and this part:
Code:

// Fn key (right alt) switches to 3rd level
    include "level3(ralt_switch)"

        modifier_map Mod3 { ISO_Level5_Lock };

If I follow your above instructions for swapping the Fn and Shift, what would I need to add in order to switch input methods using Fn or Shift with the VolumeKeys?

Or is there a way to enable switching the input methods using Ctrl + Space, without modifying the VolumeKeys?

Matan 2009-12-31 15:00

Re: N900 keyboard friendly
 
I am not sure about switching input methods. What you see works for my Hebrew keymap, which uses EIGHT_LEVEL. ctrl-space interpretation is done at a higher level, not at xkb level.

iKneaDough 2009-12-31 15:04

Re: N900 keyboard friendly
 
Quote:

Originally Posted by Matan (Post 447975)
I am not sure about switching input methods. What you see works for my Hebrew keymap, which uses EIGHT_LEVEL. ctrl-space interpretation is done at a higher level, not at xkb level.

So if you have your Fn and Shift swapped, how do you currently switch to Hebrew?

Matan 2009-12-31 15:17

Re: N900 keyboard friendly
 
Another step in making hildon-desktop keyboard friendly:

http://my.arava.co.il/~matan/770/n90...ildon_desktop3

http://my.arava.co.il/~matan/770/n900/kf/hd3.diff

Now keys work in the application menu (launcher) and window switcher:
q - selects the top left thumbnail/icon
w - selects the top, second from left
...
a - selects the left of the second row

And so on. In addition, in the window switcher pressing shift or FN together with the letter closes the window instead of moving to it.

jebba 2009-12-31 15:23

Re: N900 keyboard friendly
 
So how would one by editing /usr/share/X11/xkb/symbols/nokia_vndr/rx-51 make the Euro or Sterling symbol into tab?

iKneaDough 2009-12-31 15:48

Re: N900 keyboard friendly
 
Quote:

Originally Posted by jebba (Post 447999)
So how would one by editing /usr/share/X11/xkb/symbols/nokia_vndr/rx-51 make the Euro or Sterling symbol into tab?

Change this line:
Code:

key <AB01> { [ z, Z, sterling, sterling ] };
to this:
Code:

key <AB01> { [ z, Z, Tab, Tab ] };

Matan 2010-01-08 15:06

Re: N900 keyboard friendly
 
Here's the latest version: http://my.arava.co.il/~matan/770/n90...ildon-desktop4
Source: http://my.arava.co.il/~matan/770/n900/kf/hd4.diff

To install, run as root:
Code:

cd /root
wget http://my.arava.co.il/~matan/770/n900/kf/hd.gconf
. ./hd.gconf
wget  http://my.arava.co.il/~matan/770/n900/kf/hildon-desktop4
mv /usr/bin/hildon-desktop.launch /usr/bin/hildon-desktop.launch1
mv /root/hildon-desktop4 /usr/bin/hildon-desktop.launch
/etc/init.d/hildon-desktop stop
sleep 2
/etc/init.d/hildon-desktop start

The keyboard related behaviour of hildon-desktop is now configured by 7 gconf boolean keys:
  • /apps/osso/hildon-desktop/key-actions/default_launcher_positions
    If this key is false, the default positions of the icons in the launcher are disabled, so you can reorder them arbitrarily.
  • /apps/osso/hildon-desktop/key-actions/home_contacts_phone
    If this key is false, the phones and contacts applications will not be called when a key is pressed while in the home screen.
  • /apps/osso/hildon-desktop/key-actions/ctrl_backspace
    If this key is false then ctrl-backspace is free for applications to use, instead of the default behaviour of jumping to task navigator.
  • /apps/osso/hildon-desktop/key-actions/preset_shift_ctrl
    If this key is true, ctrl-shift-x opens an xterm, ctrl-shift-p saves an image of the screen, ctrl-shift-n toggles composite mode and ctrl-shift-h jumps to home screen.
  • /apps/osso/hildon-desktop/key-actions/dbus_shift_ctrl
    If this key is true, then ctrl-shift-letter combinations are reported on the d-bus, allowing implementation of global shortcut keys. H,N,P,X are reported on the dbus only if the previous key is false.
  • /apps/osso/hildon-desktop/key-actions/launcher_navigator_accel
    If this is true, icons in the launcher and task navigator can be selected by pressing corresponding keys:
    • q selects leftmost icon in top row.
    • w selects second icon from left in top row.
    • t selects fifth icon from left in top row.
    • s selects second from left icon in second row.
    • z selects leftmost icon in third row.
    • v selects fourth icon from left in the third row.
    etc.
    In the task navigator, if the letter is pressed with shift or FN, the corresponding task is closed, instead of switched to.
  • /apps/osso/hildon-desktop/key-actions/dbus_launcher_navigator
    If this key is true, a press of a letter key while in task navigator or launcher is reported on the d-bus. If the previous key is true, only letters not corresponding to icons are reported. If home_contacts_phone key is false, then also keys pressed while in home screen are reported.
  • Non-configurable changes:
    • Left and right arrows change desktops in the home screen.
    • A d-bus signal set_state allows other programs to select the state (application, home screen, task navigator, launcher).

codeMonkey 2010-01-09 08:54

Re: N900 keyboard friendly
 
Fantastic work, Matan!
Can you clarify how to re-order the launcher applications? I assumed it was through /etc/xdg/menus/hildon.menu, but the order there doesn't correspond with the current order in the launcher.

Also, any chance of a config option for the speed of the transition between desktops? It takes a while at the moment.

Matan 2010-01-09 10:17

Re: N900 keyboard friendly
 
A .desktop or .directory file may have a line like:
X-Osso-User-Position=1
And the icons are ordered by the values, with smaller first.

codeMonkey 2010-01-09 13:28

Re: N900 keyboard friendly
 
Thank you, that was exactly what I needed.

Matan 2010-01-10 14:21

Re: N900 keyboard friendly
 
A new version is available: http://my.arava.co.il/~matan/770/n90...ildon-desktop5
Source: http://my.arava.co.il/~matan/770/n900/kf/hd5.diff

This new version also includes a new hdk file: http://my.arava.co.il/~matan/770/n900/kf/hdk5 which should be copied to /usr/local/bin/hdk

Changes from previous version include:
  • ctrl+. ctrl+, ctrl+Space are now also global short cut keys.
  • Added signals:
    • activate_window with one integer argument, activates the nth window ordered as in the task navigator display.
    • activate_window_time with one integer argument, activates the nth window ordered by the last time window was activated. Use negative numbers to count from newer, instead of older.
    • Same calls with close instead of activate, to close the window.
    Those signals can only work when the task navigator is displayed.
  • With the included hdk (and the files http://my.arava.co.il/~matan/770/n900/kf/launcher and http://my.arava.co.il/~matan/770/n90...hildon-desktop which should be copied to /usr/local/bin and made executable), ctrl-space activates the previously active window, so in effect it can be used to alternate between two windows.
    Those new signals are enough to make ctrl-space (or another keys combination) behave like Alt-Tab.

About the speed of desktop switching, faster switching (not configurable) will be in the next version.

Helmuth 2010-01-10 20:31

Re: N900 keyboard friendly
 
Quote:

Originally Posted by Matan (Post 462362)
  • ctrl+. ctrl+, ctrl+Space are now also global short cut keys.

Mmh... in some European Countries, at example Germany, but also France, are the keys . and , combined in one Button.

In my opionion this shourtcuts wouldn't work at this devices.

codeMonkey 2010-01-11 08:12

Re: N900 keyboard friendly
 
Haha, ooops - just managed to bork my n900 by replacing hildon-desktop with hildon-desktop5, rather than replacing hildon-desktop.launch... Was due a reflash anyway ;)

dc88 2010-01-11 15:15

Re: N900 keyboard friendly
 
Quote:

Originally Posted by Matan (Post 447940)

After editing rx-51, use the command setxkbmap to activate it.

Thank you for the walkthrough. However, when I get to this last part, I'm not sure what to do. I get the message:

"Error loading new keyboard description"

What exactly should I be typing at this step?

Toda raba

Matan 2010-01-11 16:11

Re: N900 keyboard friendly
 
Your rx-51 file is not correct. Did you edit it by hand? try redownloading a working file and edit again you changes with more care for the details.

dc88 2010-01-12 00:11

Re: N900 keyboard friendly
 
Yes, I did change it by hand and I tried to be very careful. I should have made a backup first but did not.

Just to make sure though, what should I be typing in xterm to load the keyboard? Just 'setxkbmap', or do I have to give some additional instructions? I am completely new to Linux.

Thanks.

dc88 2010-01-12 01:27

Re: N900 keyboard friendly
 
I reset the phone. Now it gets stuck at the second set of dots on the loading screen (after the Nokia logo) and will not boot up. Also, every time I reset it now, in the top left hand corner of the screen a different item from my desktop comes up.

That is to say, the first time it got stuck, the shortcut button to a countdown timer appeared there. The rest of the screen was black except for the loading dots.

The second time, the shortcut to xournal appeared there.

Third time, a thumbnail shortcut to a webpage appeared there. Loading dots keep going indefinitely.

I'm fully charging the battery now so I can do a reflash. Is it possible to fix this without reflashing?

Thanks for the help.

F2thaK 2010-01-13 15:04

Re: N900 keyboard friendly
 
this has altered the order of my menu for a while now and after updating to newest ver + new files has bricked my device ! aah prob wont use again.. have verified this is prob.. :( liked the functionality of it tho

Matan 2010-01-14 16:01

Re: N900 keyboard friendly
 
A new version is available, This is for PR1.1: http://my.arava.co.il/~matan/770/n90...ildon-desktop6

Source patch (relative to 2.2.120 source): http://my.arava.co.il/~matan/770/n900/kf/hd6.diff

The only difference from previous version other than rebasing to PR1.1 is that changing desktops by arrows is faster now.

About problems: this is a work in progress, so there are expected to be bugs. I only release binaries that worked for me for some time, but obviously I cannot test everything. I still suspect that at least some of the problems are due to not following installation instructions properly.

For recovery in case of problems:
  • The method I use is a bootmenu + another boot partition. This allows me to restore a known good hildon-desktop in case that I installed one that causes a reboot loop.
  • Another option is to install openssh server before hand, and use flasher-3.5 to enable rd-mode. I expect that this will prevent reboots in case of hildon-desktop crashes, so while you can't actually use the device, you can ssh into it and restore a working hildon-desktop.

I'll be happy if people who find a serious bug and have the patience to work on the bug and a have (or are willing to install) a recovery method contact me by private message or email.

codeMonkey 2010-01-14 16:06

Re: N900 keyboard friendly
 
I'll give this one a try tonight after I've upgraded :)

jsuggs 2010-01-14 16:32

Re: N900 keyboard friendly
 
Not trying to hijack this, but are there any tips/tricks (outside of remapping keys) for getting ctl-shift-X to work? It is impossible to do without some serious (unnatural) contortions of the hand for me to do.

Matan 2010-01-14 16:37

Re: N900 keyboard friendly
 
If you do not remap keys, then ctrl and shift are where they are, and you need to press them + another key. It is possible to use ctrl+fn for shortcuts instead of ctrl+shift, but only if you are willing to give up the special characters panel that opens by ctrl+fn.

F2thaK 2010-01-15 03:42

Re: N900 keyboard friendly
 
Quote:

Originally Posted by Matan (Post 471172)
A new version is available, This is for PR1.1: http://my.arava.co.il/~matan/770/n90...ildon-desktop6

Source patch (relative to 2.2.120 source): http://my.arava.co.il/~matan/770/n900/kf/hd6.diff

The only difference from previous version other than rebasing to PR1.1 is that changing desktops by arrows is faster now.

About problems: this is a work in progress, so there are expected to be bugs. I only release binaries that worked for me for some time, but obviously I cannot test everything. I still suspect that at least some of the problems are due to not following installation instructions properly.

For recovery in case of problems:
  • The method I use is a bootmenu + another boot partition. This allows me to restore a known good hildon-desktop in case that I installed one that causes a reboot loop.
  • Another option is to install openssh server before hand, and use flasher-3.5 to enable rd-mode. I expect that this will prevent reboots in case of hildon-desktop crashes, so while you can't actually use the device, you can ssh into it and restore a working hildon-desktop.

I'll be happy if people who find a serious bug and have the patience to work on the bug and a have (or are willing to install) a recovery method contact me by private message or email.



how do we install this new version then?
i want this functionality but dont want to stuff my n900 testing it......
thx

Matan 2010-01-15 07:06

Re: N900 keyboard friendly
 
If you have a working system, installation consists of (as described in detail in previous post): set gconf keys, backup current hildon-desktop.launch (with mv command), and copy latest hildon-desktop from my page to /usr/bin/hildon-desktop.launch . The extra steps with dbus-scripts and hdk are only needed if you want to use global shortcut keys.

This should not cause a non-working system, but if it does, you need one of the recovery methods described earlier, or a reflash.

F2thaK 2010-01-16 13:53

Re: N900 keyboard friendly
 
have installed latest ver onto pr1.1 firmware'd device....... works!!! nice! faster desktop swapping...... THANKS

codeMonkey 2010-01-28 20:07

Re: N900 keyboard friendly
 
Hi Matan

I'm experiencing a compatibility problem between camkeyd and the modified hildon-desktop.
Using the genuine Ctrl-Backspace key works just fine from the desktop, but pressing the camera key (which emulates the ctrl-backspace) is causing hildon-desktop to crash.
The /apps/osso/hildon-desktop/key-actions/ctrl_backspace_in_tasknav is set to 5.
I'm not quite sure which program is responsible, so I've brought it here first.
What other info can I give to you?

Matan 2010-01-28 20:50

Re: N900 keyboard friendly
 
I don't see this. Do you have any other customizations - especially transitions.ini?

codeMonkey 2010-01-28 21:41

Re: N900 keyboard friendly
 
I didn't have any mods against transitions - but whatever you did in the deb you pm'ed worked :) Thanks again!


| 1   2   | Next
All times are GMT. The time now is 08:44.

vBulletin® Version 3.8.8