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, second thread. (https://talk.maemo.org/showthread.php?t=41389)

Matan 2010-01-19 18:50

N900 keyboard friendly, second thread.
 
This is the second thread for my project in which I aim to make the N900 usable without touching the screen.

The programs are now installable by packages which are available in my repository. You can install the keyboard shortcuts package by using this install file. If you want to add the repository manually, add the line
Code:

deb http://my.arava.co.il/~matan/repo/binary/ ./
to the file /etc/apt/sources.list .

The repository includes modified-hildon-desktop (see description of this package on the wiki page) and keyboard-shortcuts. Keyboard shortcuts are still only configurable by editing the python script /usr/bin/keyboard-shortcut, but I hope looking at the file will make it easy for anyone to configure it as they want.

The default shortcuts in the package include:
ctrl+shift+
  • a - control panel
  • b - empty browser window
  • d - disconnect from network
  • f - FBReader
  • i - tmo new posts page
  • k - toggle full screen (if you have wmctrl installed)
  • l - launcher
  • m - claws mail
Single press in task navigator or launcher:
  • l - go to launcher
  • k - go to task navigator
  • h - go to home screen
  • o - open google.com

Kamikaze 2010-02-10 23:36

Re: N900 keyboard friendly, second thread.
 
Massive thanks for your work on this Matan, I’ve only installed the base Modified Hildon Desktop package and seems really useful already.

I’m just a little confused how to implement the other custom tweaks to this from the Wiki page. Apologies if this is a very basic question, I’ve no previous linux experience and I only opened the x-terminal for the first time yesterday so somewhat of a beginner. I have since done a few of the other simple MODs from the MOD thread (LED colour change, swapping Shift/Fn keys etc.) though so I can follow instructions if explained simply.

It’s the first paragraph from the wiki page that I’m not quite sure about...

Quote:

From wiki
A few gconf keys affect the operation of hildon-desktop (change value of keys with the terminal command gconftool-2 -s <key> -t <key type> <new value>, where <key type> is int for integer values and bool for true/false values):
I understand (I think) that you type the commands into the x-terminal in order to activate other features, I’m just not 100% on what I have to add in the gaps, especially with the “int” and “bool” bits. Please could you/someone explain for a noob like me what I have to put or put in a example of how a command should look so I can work it out for myself? I did look at the other (old) thread but it said to disregard the information as it was now obsolete.

Cheers

Matan 2010-02-10 23:47

Re: N900 keyboard friendly, second thread.
 
I added gconftool-2 examples to the wiki page. I hope they clarify the issue.

Thor 2010-02-10 23:51

Re: N900 keyboard friendly, second thread.
 
Is it possible to have a target the size of an icon square that can be moved like on normal Symbian and other non-touch OS's? Kinda like how the Blackberry Storm lets you select without activating until actually pressed. This way we could use the arrow keys to highlight things and a button like enter/space/ctrl etc as select. It would have to be different on the homescreen, perhaps an intelligent highlight that cycles through what's on the screen with up and down, and left and right to change desktop screens.

Ok I'm probably thinking of something way too complicated... as it would only be active with the keyboard open.

j.s 2010-02-11 00:06

Re: N900 keyboard friendly, second thread.
 
Quote:

Originally Posted by Thor (Post 520391)
Is it possible to have a target the size of an icon square that can be moved like on normal Symbian and other non-touch OS's? Kinda like how the Blackberry Storm lets you select without activating until actually pressed. This way we could use the arrow keys to highlight things and a button like enter/space/ctrl etc as select. It would have to be different on the homescreen, perhaps an intelligent highlight that cycles through what's on the screen with up and down, and left and right to change desktop screens.

Ok I'm probably thinking of something way too complicated... as it would only be active with the keyboard open.

I don't think it is too complicated to ask for at all. And it is a very good idea.

But Maemo 6 will also have desktops above and below. I think up, down, left, right to move from icon to icon and add shift to arrow to change desktops.

I would also like to be able to use arrow keys to fine tune icon placement. Put desktop in icon location change mode, tap icon to select, then each arrow key press moves the icon 1 pixel.

Kamikaze 2010-02-11 00:14

Re: N900 keyboard friendly, second thread.
 
Quote:

Originally Posted by Matan (Post 520385)
I added gconftool-2 examples to the wiki page. I hope they clarify the issue.

Yeah got it working, now that I've seen the the examples I can see I was being rather slow :p

Thanks again.

Kamikaze 2010-02-11 02:22

Re: N900 keyboard friendly, second thread.
 
I have also set up the keyboard-shortcuts app now but due to another MOD I've put in reversing the mapping of the Shift and Fn keys to make shortcuts like Ctrl+Shift+X (open X-terminal) and Ctrl+Shift+H (Go to homescreen) easy to do without a stretch all the following shortcuts:

Quote:

The default shortcuts in the package include:
ctrl+shift+
a - control panel
b - empty browser window
d - disconnect from network
f - FBReader
i - tmo new posts page
k - toggle full screen (if you have wmctrl installed)
l - launcher
m - claws mail
now have the same problem (difficult to press). Does anyone know a way of turning the following feature off...

Quote:

Originally Posted by From Wiki
/apps/osso/hildon-desktop/key-actions/dbus_shortcuts_use_fn
use ctrl+FN+key instead of ctrl+shift+key for D-Bus shortcuts. This is much easier to press, but conflicts with FN+ctrl for opening special keys window.

And if this would help? I've tried entering "-t bool false" and "-t bool true" after the command but it doesn't seem to make a difference.

Or if not, is it possible to change what's in the /usr/bin/keyboard-shortcut script so the all of those shortcuts are meant to work with Ctrl+Fn+<other key> (and consequently, as the mapping is reversed, the easier combination of Ctrl+Shift+<other key> ?

Sorry if this sounds convoluted, basically what I am trying to achieve is to have all the shortcuts that require 3 keys to be pressed to be done using the actual Shift + Fn buttons.

Cheers

Matan 2010-02-11 10:59

Re: N900 keyboard friendly, second thread.
 
/apps/osso/hildon-desktop/key-actions/dbus_shortcuts_use_fn is only read at startup time, so you need to reboot (or simply "killall hildon-desktop", but that does not always work).

Kamikaze 2010-02-11 12:20

Re: N900 keyboard friendly, second thread.
 
Perfect, thanks :)

marktold 2010-02-11 12:47

Re: N900 keyboard friendly, second thread.
 
I think you do great work. But let me tell you about user friendly keyboard.

I don't know what layout you have on your keyboard. On my Swiss keyboard

Shift - all the way to the left on bottom row
Strg - all the way to the left on top row.

I just dont find a way to press these two buttons with two fingers of the same hand without making strange faces. I guess my fingers are just to wide.

And if I use fingers of both hands I miss my third hand to hit the extra key.

Am I the only one with this problem.

Markus

Matan 2010-02-11 12:50

Re: N900 keyboard friendly, second thread.
 
I used to exchange shift and fn, so shift and ctrl were next to each other and could be pressed by a single finger. There is also the option dbus_shortcuts_use_fn (discussed above in this thread) which makes shortcuts use ctrl+fn, which are next to each other by default, so you get the same effect. It might conflict with fn+ctrl for opening special virtual keyboard, so you have to make sure you press ctrl first and fn second.

Kamikaze 2010-02-11 16:27

Re: N900 keyboard friendly, second thread.
 
I'm trying to change the keyboard shortcuts to launch different application with Ctrl + Shift + <Letter Key> combinations but as yet have not been successful. I'm editing the /usr/bin/keyboard-shortcut script in leafpad and I used the existing "FBReader" shortcut as a template to try to get it to work for other apps.

Under the section “# CTRL + SHIFT + KEY

I replaced the lines:

If key == ‘F’:
osso_exec(“FBReader”)


With:

If key == ‘F’:
osso_exec(“Media player”)


I then saved and rebooted but nothing happened when I pressed Ctrl + Shift + <F>

I tried to do the same but instead putting in the line:

If key == ‘F’:
osso_exec(“Firefox”)


but again nothing when pressing Ctrl + Shift + <F>. The original shortcuts from the script like Ctrl + Shift + <A> - Control panel work fine. Can anyone see what I am doing wrong here? Is the way in which app names are displayed in the launcher different to the app name that this script looks for?

Also, does it require a different command for native apps like Media player to installed apps like Firefox?

qwerty12 2010-02-11 16:31

Re: N900 keyboard friendly, second thread.
 
Quote:

Originally Posted by Kamikaze (Post 521390)
[...]
If key == ‘F’:
osso_exec(“Media player”)

[...]

"Media player" and "Firefox" don't exist. You want "mediaplayer" and "browser" respectively.

Kamikaze 2010-02-11 16:34

Re: N900 keyboard friendly, second thread.
 
Thanks, how do I find out the name of applications that the script looks for?

Kamikaze 2010-02-11 16:46

Re: N900 keyboard friendly, second thread.
 
I've tried again using:

If key == ‘F’:
osso_exec(“mediaplayer”)


and then

If key == ‘F’:
osso_exec(“browser”)


and rebooting after each edit but still no luck. I can only assume I am either editing the section incorrectly or need to make edits somewhere else as well. Anyone have any ideas please?

Matan 2010-02-11 17:20

Re: N900 keyboard friendly, second thread.
 
Find the names by examining the files in /usr/share/dbus-1/services/. You need to look at the line Name= in each file and ignore the com.nokia at the start.

fennec is called mozilla.fennec, so it cannot be executed by the osso_exec function. You need to copy the four lines in osso_exec definition and replace com.nokia.+name and /com/nokia/name with mozilla.fennec.

mediaplayer is another issue, since executing it just runs the background process. You still need to find out how to make it open a window.

You don't need to reboot after editing the script, since it is executed at each key press.

Note that it is a python script, so white space is important, etc.

You can debug your changes by running from the command line

/usr/bin/keyboard-shortcuts a b c d 198

where a b c d are any four parameters (ignored by the script) and 198 is 192+ the letter you wish to emulate (198 being f).

Oleg 2010-02-17 10:05

Re: N900 keyboard friendly, second thread.
 
Hi, I have a little problem. I used Ctrl + Space to change hardware keyboard layout from Russian to English and back. Now after I installed the application this shortcut is replaced by
Quote:

if (kn == 247) or (kn == 248) or (kn == 228):
import time
os.system("/usr/bin/dbus-hildon-desktop set_state 64")
time.sleep(0.4)
os.system("/usr/bin/dbus-hildon-desktop activate_window_time -2")
print "<ctrl>F7"
I commented that out but I still cannot switch layout by pressing Ctrl+Space. Uninstalling the application doesn't do the trick either.
Do you have any ideas how to fix this?

low life 2010-02-17 12:15

Re: N900 keyboard friendly, second thread.
 
Thanks a lot for this, I've been using an older version for a while and now after upgrading to the newest one I'm loving the ctrl-backspace alt-tab functionality, along with network disconnect shortcut.. now I just need to remember to use them. Still using the hack you posted earlier to swap Fn and shift, I'm used to it but anyone else who tries the device seems to get slightly confused :)

Any idea if the default mail client can be launched using osso_exec (or some other way)? Also, finding a way to either a) reconnect to the last used connection or b) connect to a certain (3G) connection would be great.

edit:Found a way to launch default email:
Code:

if key == 'm':
        if os.fork() == 0:
                os.system("modest -s")

final edit: updated to much simpler form after finding os.fork() to allow further shortcuts after launching email

Oleg 2010-02-19 13:39

Re: N900 keyboard friendly, second thread.
 
Ok, since there is no answer I guess I'll have to reflash the device :(
Maybe it's just not the right thread for reporting this?

low life 2010-02-19 14:07

Re: N900 keyboard friendly, second thread.
 
Just throwing random thoughts around, but did you try changing the state of /apps/osso/hildon-desktop/key-actions/dbus_ctrl_shortcuts?

first do: gconftool-2 -g /apps/osso/hildon-desktop/key-actions/dbus_ctrl_shortcuts
then set it to the other one with:
gconftool-2 -s /apps/osso/hildon-desktop/key-actions/dbus_ctrl_shortcuts -t bool true/false

Oleg 2010-02-19 14:56

Re: N900 keyboard friendly, second thread.
 
Thanks for response
I got this:
Quote:

~ $ gconftool-2 -g /apps/osso/hildon-desktop/key-actions/dbus_ctrl_shortcuts
No value set for `/apps/osso/hildon-desktop/key-actions/dbus_ctrl_shortcuts'
~ $ gconftool-2 -s /apps/osso/hildon-desktop/key-actions/dbus_ctrl_shortcuts -t bool true
~ $ gconftool-2 -s /apps/osso/hildon-desktop/key-actions/dbus_ctrl_shortcuts -t bool false
Error while parsing options: Invalid byte sequence in conversion input.
Run 'gconftool-2 --help' to see a full list of available command line o
I restarted the device and now layout switch shortcut works. Thanks again!

Matan 2010-02-19 16:57

Re: N900 keyboard friendly, second thread.
 
Quote:

Originally Posted by Oleg (Post 536541)
Ok, since there is no answer I guess I'll have to reflash the device :(
Maybe it's just not the right thread for reporting this?

It is the correct thread, it's just that I spent the ln the cold planes of Tatarstan, so in the short period I had to browse this forum I missed this thread.

As you have been told, setting the key /apps/osso/hildon-desktop/key-actions/dbus_ctrl_shortcuts to false disables capturing of ctrl-space. But should default to false. Are you sure you did not set it to true?

Your gconftool-2 error seems to be like there is some hidden character. This might happen if you type a 2 byte char (a Cyrillic letter) and then delete it. Please try to retype the command. Remember also that this key is only read once when hildon-desktop starts, so for this change to take effect you need to restart hildon-desktop, by running killall hildon-desktop, or rebooting.

If you want to return to standard hildon-desktop you certainly don't need to reflash the device.
You can reinstall the hildon-desktop package. Download it from here: http://repository.maemo.org/pool/fre...+0m5_armel.deb
And install it with dpkg -i .

low life 2010-02-19 18:02

Re: N900 keyboard friendly, second thread.
 
I remember being able to close apps by tapping shift and then the relevant key (q, w, e, etc.), now it seems to require me to press both keys at the same time.. is this the intended behaviour? I liked the old way, made it easy to close apps quickly using just one hand.

The ctrl-backspace is set to alt-tab behaviour, if that makes any difference.

Matan 2010-02-19 18:16

Re: N900 keyboard friendly, second thread.
 
shift and then q works for me. Are you using the latest version? Does the cogwheel appear when you press shift (or fn)?

low life 2010-02-19 19:52

Re: N900 keyboard friendly, second thread.
 
Yeah I'm using the latest version, and now that I tried it again seems that it works if I first hold shift done for a while - a second or so, but not if I tap it quickly (like I do when I type capital letters). The cogwheel also appears if I hold shift down for a while and then release it, not if I just tap it quickly.

codeMonkey 2010-02-20 18:09

Re: N900 keyboard friendly, second thread.
 
Hey Matan

Just to let you know, and in case anyone else installs it:
I had a modified-hildon-desktop update come through today - the update itself seemed to go fine, but hildon-desktop didn't start again correctly afterwards, and trying to re-start it from the console seemed to hang too.

After a reboot everything was fine, it seemed to start as usual.

Matan 2010-02-20 18:19

Re: N900 keyboard friendly, second thread.
 
Yes it seems to happen from time to time. Usually disabling and then enabling compositing mode (with ctrl-shift-n) fixes the issue, but rarely it does not.

My guess is that it is a problem with the graphics driver, as the issue also happens when both the stopped and the started hildon-desktop are the original ones.

low life 2010-02-22 17:06

Re: N900 keyboard friendly, second thread.
 
I've bumped into a problem again..

I made ctrl+shift+i launch an SSH connection using X-term with the following line:
os.system("/usr/bin/osso-xterm 'ssh user@server'")

The shortcut works, with the right key combination launching an SSH connection. However, further ctrl+shift combinations don't work until I close the terminal with SSH in it, and after closing it all the ctrl+shift presses I've used while it's open seem to be executed (so I do ctrl+shift+b 5 times when SSH is open, nothing happens, but when I close the SSH terminal I get 5 empty browser windows). If I copy the text printing part from ctrl+shift+d function, that text is also printed when closing the SSH window, not as it's opened.

What makes this interesting, however, is that if I have another terminal window (just an idle terminal, doesn't need to have an SSH connection or anything) open before I use the SSH connection shortcut, everything seems to work as it should, the text is printed when I use the shortcut and ctrl+shift key press functions are executed as expected. The shortcuts also work if I open the SSH connection from my desktop shortcut pointing to "osso-xterm 'ssh user@server'".

Is os.system() the wrong way to do this, or is it just something I'll need to get used to? It's only a minor annoyance, since I can do ctrl+shift+x before ctrl+shift+i and it works fine, but would be great if someone knew how to do this right.

Matan 2010-02-22 17:39

Re: N900 keyboard friendly, second thread.
 
os.system indeed blocks, so the script does not run again.

Use something like (an example will be in the script in the next version):
Code:

  if key == 'i':
    if os.fork() == 0:
      os.system("osso-xterm 'ssh user@server'")


Matan 2010-03-29 23:42

Re: N900 keyboard friendly, second thread.
 
If someone installs PR1.2 (when it becomes available) and wished to try, the packages (only tested on X86 PR1.2 SDK) are:
http://my.arava.co.il/~matan/770/n90..._2.0_armel.deb

http://my.arava.co.il/~matan/770/n90...+0m5_armel.deb

(the second is only needed for more than 4 desktops).

low life 2010-03-31 12:03

Re: N900 keyboard friendly, second thread.
 
So, I've another question: Is it possible to have a keyboard shortcut to close the current active window the same way it'd be closed when clicking the 'x' in the task switcher? What happens after this I don't really care about, being left in the task switcher would be ok.

Would launching task switcher and then sending the signal to close newest window do the trick?

I'll have a go at this later tonight myself if no one can answer and report my progress.

Matan 2010-03-31 13:36

Re: N900 keyboard friendly, second thread.
 
"Launching task switcher and then sending the signal to close newest window" does appear to work.

It should be easy to implement a keyboard shortcut for this using keyboard-shortcuts package.

Note also that a few programs still have the old behaviour of closing on long press of Escape key. You just need to remap the hardware keyboard to have such a key.

low life 2010-03-31 15:38

Re: N900 keyboard friendly, second thread.
 
Yeah it does seem to work, great. Used time.sleep() to wait a while before sending the signal to close newest window (I'm guessing this is the best way to do it?), other than that it's just a couple of dbus-signals.. easy enough. Here's my script in keyboard-shortcut:

Code:

import time


if key == 'y':
    os.system("dbus-send --type=signal --session /com/nokia/hildon_desktop com.nokia.hildon_desktop.exit_app_view
")

    time.sleep(0.5)

    os.system("/usr/bin/dbus-hildon-desktop close_window_time -1")

Also I updated to 1.15 of modified-hildon-desktop today, task switcher seems to be a lot snappier than earlier.. could of course be because of the reboot I did after installing it, but either way I'm not complaining. I don't think I could use the device without modified-hildon-desktop and keyboard-shortcuts anymore, thanks a lot! :)

Matan 2010-04-06 10:40

Re: N900 keyboard friendly, second thread.
 
The package http://my.arava.co.il/~matan/770/n90...+0m5_armel.deb adds a dbus signal for opening status menu. To use:
Code:

bus-send --type=signal --session /com/nokia/hildon_desktop com.nokia.hildon_desktop.open_status_menu
Together with keyboard-shortcuts, this allows opening the status menu with the keyboard.

dottmercurio 2011-09-09 19:36

Re: N900 keyboard friendly, second thread.
 
Matan Hello, I greatly admired your work.
I have tried in various ways, but I can not run shortcuts such as ctrl + shift + f for FBReader, and even hot keys k, or l, h
I installed your Hildon that works well, and keyboard-shortcut.

This is the result of the command gconftool-2 -R /apps/osso/hildon-desktop/key-actions

dbus_shortcuts_use_fn = true
launcher_navigator_accel = true
home_contacts_phone = false
dbus_launcher_navigator = true
dbus_shift_ctrl = true
preset_shift_ctrl = true
disable_edit = false
ctrl_backspace = true
ctrl_backspace_in_tasknav = 5
dbus_ctrl_shortcuts = true


I hope to use your great work, thanks


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

vBulletin® Version 3.8.8