*

Welcome, Guest. Please login or register.

Get your own OLPC - Buy an XO laptop on eBay!
Pages: [1]
Print
Author Topic: olpc-kbdshim: grab keys, touchpad rotation, brightness and rotation support  (Read 10352 times)

olpc-kbdshim: grab keys, touchpad rotation, brightness and rotation support

pgf
Master Contributor
***
Posts: 309


June 30, 2009, 08:26:25 AM

hi --

just wanted to announce the "olpc-kbdshim" package for the XO.

it's packaged as rpm, and is available from both the fedora F-9 and F-11 repositories.  (being in F-9 means you should be able to "sudo yum install olpc-kbdshim" from any of the OLPC "official" distributions.)  it's not available as a .deb -- i'd be thrilled if someone was interested in helping with that, so that it could be installed easily on debian (e.g., for debxo) or ubuntu.

what does it do?  several things:

  • when either of the "grab" keys (with the hand outline on them) is pressed, both the touchpad and the arrow keys will produce scrolling events rather than their usual behavior.  this helps avoid having to aim at a tiny scrollbar, and using the arrow keys helps avoid using a jumpy touchpad.  if you're using a USB keyboard, the grab keys are the "windows logo" keys.
  • when the screen is rotated, the action of the touchpad, and of the "D-pad" arrows, will be rotated to match it.  this makes using the laptop in rotated mode much more useful.  there is also support for flipping the action of the touchpad for use in ebook mode -- i.e. when in ebook mode, you can open the laptop slightly and use the touchpad without having to reverse your finger motion.  olpc-kbdshim provides no automatic support for this, though.  (if someone can figure out how to decide both to _start_ this behavior and how to _end_ the behavior, with input from just the ebook switch, please let me know.)
  • when the brightness or rotation buttons are pressed, a corresponding script is executed to perform the action.  the scripts (olpc-brightness and olpc-rotate) are provided as part of the package, but any script could be run instead.  think of it as a key-binding mechanism for just two keys.  (i had to provide a rotation script to support the touchpad rotation.  supplying brightness helps rid sugar of a hardware dependency.)
  • lastly, olpc-kbdshim reports user activity and inactivity events to a fifo in the filesystem.  these events are used by a yet un-released package that improves the power management experience, and makes power management much more flexible.  (the new package is "olpc-powerd", and it's a replacement for the current ohmd.  you can try the copy from http://dev.laptop.org/~pgf/rpms/olpc-powerd-7-1.fc9.i386.rpm if you'd like, but be aware that it's still under development.)
paul
pgf at laptop.org

« Last Edit: June 30, 2009, 08:28:37 AM by pgf » Logged

#1 Re: olpc-kbdshim: grab keys, touchpad rotation, brightness and rotation support

mavrothal
Administrator
OLPC News Forum Expert
*****
Posts: 1289


June 30, 2009, 12:21:27 PM

when either of the "grab" keys (with the hand outline on them) is pressed, both the touchpad and the arrow keys will produce scrolling events rather than their usual behavior.  this helps avoid having to aim at a tiny scrollbar, and using the arrow keys helps avoid using a jumpy touchpad.  if you're using a USB keyboard, the grab keys are the "windows logo" keys.
Works fine with non-rotated screen. Though game keys only require one finger to scroll... Wink
Arrow-key scroll does not "see" screen rotation

Quote
when the screen is rotated, the action of the touchpad, and of the "D-pad" arrows, will be rotated to match it.  this makes using the laptop in rotated mode much more useful.  there is also support for flipping the action of the touchpad for use in ebook mode -- i.e. when in ebook mode, you can open the laptop slightly and use the touchpad without having to reverse your finger motion.  olpc-kbdshim provides no automatic support for this, though.  (if someone can figure out how to decide both to _start_ this behavior and how to _end_ the behavior, with input from just the ebook switch, please let me know.)
The touchpad rotates the opposite way. Also true when you use it to scroll in rotation. The D-pad is ok in 180 degrees rotation but move the opposite direction in 90 and 270 degrees rotation

Brightness and rotation scripts are fine.

XO-1/os767/q2e41

PS:
Quote
when the brightness or rotation buttons are pressed, a corresponding script is executed to perform the action.  the scripts (olpc-brightness and olpc-rotate) are provided as part of the package, but any script could be run instead.  think of it as a key-binding mechanism for just two keys.
Which file should be modified to attache a different script?
« Last Edit: June 30, 2009, 12:37:47 PM by mavrothal » Logged

XO-1: Is never going to run Flash, but is certainly flashy!
(If you want Flash, get an XO-1.5 running OLPC 11.2.0 or XOpup Grin )

#2 Re: olpc-kbdshim: grab keys, touchpad rotation, brightness and rotation support

pgf
Master Contributor
***
Posts: 309


June 30, 2009, 12:49:12 PM

when either of the "grab" keys (with the hand outline on them) is pressed, both the touchpad and the arrow keys will produce scrolling events rather than their usual behavior.  this helps avoid having to aim at a tiny scrollbar, and using the arrow keys helps avoid using a jumpy touchpad.  if you're using a USB keyboard, the grab keys are the "windows logo" keys.
Works fine. Though game keys only require one finger to scroll Wink
i don't understand.  you mean, because the game keys implement pgup/pgdown?  that won't help when scrolling horizontally, or if your program doesn't understand pgup/pgdown (like xterm).

Quote
Quote
when the screen is rotated, the action of the touchpad, and of the "D-pad" arrows, will be rotated to match it.  this makes using the laptop in rotated mode much more useful.  there is also support for flipping the action of the touchpad for use in ebook mode -- i.e. when in ebook mode, you can open the laptop slightly and use the touchpad without having to reverse your finger motion.  olpc-kbdshim provides no automatic support for this, though.  (if someone can figure out how to decide both to _start_ this behavior and how to _end_ the behavior, with input from just the ebook switch, please let me know.)
The touchpad rotates the opposite way. The D-pad is ok in 180 degrees rotation but move the opposite direction in 90 and 270 degrees rotation
opposite way?  remember that this is implementing scrolling, not panning -- you're moving the scrollbar, not the the pane.  but i'll install on 767 to check what you're saying -- i've been testing mainly on 802.  (and debxo)

oh -- i think this might be an X bug.  when you type "xrandr -o left", does the screen turn clockwise, or counterclockwise?

Quote
Brightness and rotation scripts are fine.

XO-1/os767/q2e41

PS:
Quote
when the brightness or rotation buttons are pressed, a corresponding script is executed to perform the action.  the scripts (olpc-brightness and olpc-rotate) are provided as part of the package, but any script could be run instead.  think of it as a key-binding mechanism for just two keys.
Which file should be modified to attache a different script?

Code:
/usr/share/hal/fdi/policy/20thirdparty/20-olpc-kbdshim.fdi

you'll see two separate definitions of the olpc-kbdshim-hal invocation, one each for the mouse and the keyboard.  be sure and change them identically, otherwise hal will spawn two instances of the daemon instead of just one (it does a text match on the commandline to be invoked to see if it should share one daemon among other singleton users).

paul
Logged

#3 Re: olpc-kbdshim: grab keys, touchpad rotation, brightness and rotation support

mavrothal
Administrator
OLPC News Forum Expert
*****
Posts: 1289


June 30, 2009, 02:09:43 PM

oh -- i think this might be an X bug.  when you type "xrandr -o left", does the screen turn clockwise, or counterclockwise?
counterclockwise.
I do not know if it's relevant but i also have installed xorg-x11-drv-geode-2.11.01.fc10.i386 as well as xcompmgr
PS: I tend to edit my posts if you use the mail notification you may miss half of it Grin
« Last Edit: June 30, 2009, 02:18:45 PM by mavrothal » Logged

XO-1: Is never going to run Flash, but is certainly flashy!
(If you want Flash, get an XO-1.5 running OLPC 11.2.0 or XOpup Grin )

#4 Re: olpc-kbdshim: grab keys, touchpad rotation, brightness and rotation support

pgf
Master Contributor
***
Posts: 309


June 30, 2009, 02:15:37 PM

oh -- i think this might be an X bug.  when you type "xrandr -o left", does the screen turn clockwise, or counterclockwise?
counterclockwise.
I do not know if it's relevant but i also have installed xorg-x11-drv-geode-2.11.01.fc10.i386

thank you.  all XO screens i've seen before go the other way.  i believe i pointed this bug out to the X11 driver author some time ago.  sounds like he fixed it.  i guess i'll have to identify the X-server...  sigh.

paul
Logged

#5 Re: olpc-kbdshim: grab keys, touchpad rotation, brightness and rotation support

mavrothal
Administrator
OLPC News Forum Expert
*****
Posts: 1289


June 30, 2009, 02:24:00 PM


thank you.  all XO screens i've seen before go the other way.  i believe i pointed this bug out to the X11 driver author some time ago.  sounds like he fixed it.  i guess i'll have to identify the X-server...  sigh.

paul
So is the 2.11.0 geode driver the problem?

What about the arrow-scroll not being aware of the rotation?
Logged

XO-1: Is never going to run Flash, but is certainly flashy!
(If you want Flash, get an XO-1.5 running OLPC 11.2.0 or XOpup Grin )

#6 Re: olpc-kbdshim: grab keys, touchpad rotation, brightness and rotation support

pgf
Master Contributor
***
Posts: 309


June 30, 2009, 02:48:08 PM


So is the 2.11.0 geode driver the problem?
yes, but i think it was wrong before, and 2.11.0 is getting it right.  (think about what "xrandr -o left" should do.)  in any case, kbdshim will have to detect the X server version somehow.

Quote
What about the arrow-scroll not being aware of the rotation?
sorry, i missed this earlier.  this is by design -- i thought  it would be confusing to have the built-in keyboard work differently than an external keyboard.
i understand that whether the keyboard arrow keys should cause rotated scrolling could be argued either way.  i'll think about it.

the D-pad will rotate correctly, whether scrolling or not, because it's fixed to the screen.

paul
Logged

#7 Re: olpc-kbdshim: grab keys, touchpad rotation, brightness and rotation support

pgf
Master Contributor
***
Posts: 309


June 30, 2009, 02:51:35 PM

the D-pad will rotate correctly, whether scrolling or not, because it's fixed to the screen.

paul

sorry -- this is wrong.  the d-pad doesn't do scrolling.  i forgot.

paul
Logged

#8 Re: olpc-kbdshim: grab keys, touchpad rotation, brightness and rotation support

mavrothal
Administrator
OLPC News Forum Expert
*****
Posts: 1289


June 30, 2009, 03:19:59 PM


So is the 2.11.0 geode driver the problem?
yes, but i think it was wrong before, and 2.11.0 is getting it right.  (think about what "xrandr -o left" should do.) 
That much i can get Grin I meant the problem with the script behavior

Quote
in any case, kbdshim will have to detect the X server version somehow.
Try thr newby way: rpm -qa | grep -i  Grin
Logged

XO-1: Is never going to run Flash, but is certainly flashy!
(If you want Flash, get an XO-1.5 running OLPC 11.2.0 or XOpup Grin )

#9 Re: olpc-kbdshim: grab keys, touchpad rotation, brightness and rotation support

mavrothal
Administrator
OLPC News Forum Expert
*****
Posts: 1289


July 05, 2009, 10:04:01 AM

lastly, olpc-kbdshim reports user activity and inactivity events to a fifo in the filesystem.  these events are used by a yet un-released package that improves the power management experience, and makes power management much more flexible.  (the new package is "olpc-powerd", and it's a replacement for the current ohmd.  you can try the copy from http://dev.laptop.org/~pgf/rpms/olpc-powerd-7-1.fc9.i386.rpm if you'd like, but be aware that it's still under development.)

paul
pgf at laptop.org
I tried olpc-powerd and looks fine in suspending and waking up the XO on lid events and dimming the screen after 2 min of inactivity.
I also found this original description from back in March. How much of it remains the same? What and how can be customized?

PS: An nice post-wakeup feature will be to try to connect immediately to WiFi (if connected before sleep) instead of going through the usual mesh-node connections first
« Last Edit: July 05, 2009, 11:58:14 AM by mavrothal » Logged

XO-1: Is never going to run Flash, but is certainly flashy!
(If you want Flash, get an XO-1.5 running OLPC 11.2.0 or XOpup Grin )

#10 Re: olpc-kbdshim: grab keys, touchpad rotation, brightness and rotation support

pgf
Master Contributor
***
Posts: 309


July 05, 2009, 06:46:32 PM

lastly, olpc-kbdshim reports user activity and inactivity events to a fifo in the filesystem.  these events are used by a yet un-released package that improves the power management experience, and makes power management much more flexible.  (the new package is "olpc-powerd", and it's a replacement for the current ohmd.  you can try the copy from http://dev.laptop.org/~pgf/rpms/olpc-powerd-7-1.fc9.i386.rpm if you'd like, but be aware that it's still under development.)

paul
pgf at laptop.org
I tried olpc-powerd and looks fine in suspending and waking up the XO on lid events and dimming the screen after 2 min of inactivity.
I also found this original description from back in March. How much of it remains the same? What and how can be customized?

PS: An nice post-wakeup feature will be to try to connect immediately to WiFi (if connected before sleep) instead of going through the usual mesh-node connections first


let's move this conversation to email ([email protected]) -- it would be much easier for me.

that description you found is still accurate, except that all of the unimplemented features are now implemented.

read /usr/sbin/powerd for details.

run "/usr/sbin/powerd-config" (of "sudo /usr/sbin/powerd" if you want to make changes) to see the config options.

as for wifi -- that's really not part of powerd.  but powerd allows for "post-resume" hooks that make it easy to add scripts for that sort of thing.
paul
Logged

#11 Re: olpc-kbdshim: grab keys, touchpad rotation, brightness and rotation support

pgf
Master Contributor
***
Posts: 309


July 06, 2009, 06:39:55 AM


my apologies -- when i responded to this, i thought i was responding to a private message.  i'd much rather use email than the forum private messages.  public threads should remain public, of course.

paul
Logged

#12 Quick n' dirty deb created

roystonlodge
Commenter

Posts: 10


December 15, 2009, 05:44:57 PM

I quickly used alien to convert the rpm to a deb.  I haven't tested it, but folk are certainly free to download it and try it out.

Be aware, this is a temporary link that will delete in 48 hours or so, so download it now:

http://www.sendspace.com/file/yesfxm
Logged

- OLPC XO running DebXO & LXDE
- Pentium III running Damn Small Linux
- Mac Mini 1.25mhz running OSX 10.4
- AMD Athlon 1.9mhz running Windows XP
Pages: [1]
Print
Jump to:  

Members
Total Members: 2406
Latest: sembik
Stats
Total Posts: 31943
Total Topics: 3843
Online Today: 36
Online Ever: 238
(April 18, 2011, 09:48:50 PM)
Users Online
Users: 0
Guests: 17
Total: 17