*

Welcome, Guest. Please login or register.

Get your own OLPC - Buy an XO laptop on eBay!
Pages: 1 [2] 3 4
Print
Author Topic: Pseudo-mouse & keyboard in tablet mode  (Read 58012 times)

#15 Re: Pseudo-mouse & keyboard in tablet mode

Directive0
Master Contributor
***
Posts: 375



March 28, 2008, 09:42:57 AM

Okay, I'm going to swallow my pride and post.  I'm totally lost.

I ran your script and I can confirm everything installed correctly.  All the scripts you walk us through in your first post are already there, they work great so long as I activate the scripts from the terminal.  But then I get the part where you say your script won't set up keybinding for us.  Could you elaborate on what must be done to define those bindings?  I opened the keyhandler.py file in nano and couldn't find anywhere to just drop the scripts in, there was no mention of the rotate button ID or anything.  I'm not going to edit the file without knowing what I'm doing, so some directed learning would be awesome Smiley

And either way, thanks for posting this!  You rule!
« Last Edit: March 28, 2008, 09:46:27 AM by Directive0 » Logged

#16 Re: Pseudo-mouse & keyboard in tablet mode

samphilomath
Senior Contributor
**
Posts: 214


Let GO my XO


WWW
March 28, 2008, 10:10:50 AM

Scrub I edited my first post again, Hope I made it clear now.
http://olpcnews.com/forum/index.php?topic=1996.msg19390#msg19390

You are doing a great job.
Logged

#17 Re: Pseudo-mouse & keyboard in tablet mode

mattd
Senior Contributor
**
Posts: 111


March 29, 2008, 12:24:18 PM

Hey mattd,

Sweet, thanks for the link to the ergonomic touchpad!  Their website talks about Windows and Macintosh, but I don't see anything about linux, so maybe we need to wait for drivers before it'll work with the XO? :/  I'd love to hear if anyone gets it working!

Hey scrub. The ergotouchpad doesn't work with the XO. Yet.

The manufacture said they've had several folks use it on other Linux systems, but the XO's touch pad is pretty heavily modified (from what I've read). Hence all the problems people have had with the over sensitivity.  But, Ive got some leads to follow and will let every body know if/when I get it working.

I'll be installing your hack when I get the time - see if I can get it working on Xfce. And working on the touchpad after that. Smiley
Logged

#18 Re: Pseudo-mouse & keyboard in tablet mode

heiman
New

Posts: 4


April 05, 2008, 12:53:37 PM

I was able to get scrub's excellent hack running -- mostly -- with the native Sugar windows manager (without running fluxbox), thanks to advice throughout this thread.  DirectiveO, I believe this is what you were looking for.

First, download and run scrub's install.sh script. Then, as root ('su'), edit /usr/share/sugar/shell/view/keyhandler.py as follows (remember to back up a copy first).

1. change

'0xEB'      : 'rotate'

to

'<ctrl>0xEB'     : 'rotate'
'0xEB'               : 'mousekeys'

This reassigns the "rotate" key on the display to a new function we're calling mousekeys, and creates a new shortcut (ctrl+rotate-key) to trigger the old display rotation function.

2. Look for the block of lines beginning 'def handle_rotate(self):'.  Before or after that entire block of lines, add the following

def handle_mousekeys(self):
    subprocess.call("/usr/bin/togglemousekeys.sh",shell=True)

This will execute scrub's togglemousekeys.sh script when the "mousekeys' function we created in step 1 gets triggered.

3. Restart Sugar (ctrl-alt-erase) and you should be able to hit the rotate button and switch into mousekeys mode (rocker pad will control mouse).  Hit rotate button again to switch out.  Hit ctrl-rotate to rotate the display as normal.

Unfortunately I haven't yet found the code to refer to the gamepad buttons (circle, square, check, x-key) so I haven't been able to implement the rest of scrub's work -- but the solution would be similar, if someone can post what the "0xEB" equivalent for those keys is.
Logged

#19 Re: Pseudo-mouse & keyboard in tablet mode

JoeMac
Senior Contributor
**
Posts: 108


April 09, 2008, 02:41:11 PM

Wow...that's just about all I can say.  That, and I want that capability.  I'm stil too new to Linux to attempt this within XFCE or Xubuntu, but I'm hoping others will lead the charge.

« Last Edit: April 12, 2008, 07:39:52 AM by JoeMac » Logged

#20 Re: Pseudo-mouse & keyboard in tablet mode

孟柯
Commenter

Posts: 11



April 24, 2008, 03:02:37 AM

Totally new at this, but I used 'xev' to find out the code for the gamepad buttons (circle, square, check, x-key):

Key             Key Code         HID             Name
circle               81                 0xff9a        KP_Prior
square             79                 0xff95        KP_Home
x-key               89                 0xff9b         KP_Next
check              87                 0xff9c         KP_End

I hope this helps. I've gotten (almost) everything working thanks to scrub and heiman. The only thing is that I can't toggle virtual keyboard. Also, when I type xvkbd in the terminal it launches as full screen and once I leave it I can't cycle back using alt+tab (and so can't focus). I've tried messing with the geometry, but that just resized the buttons and font (still full screen).

Any ideas?
Logged

#21 Re: Pseudo-mouse & keyboard in tablet mode

mattd
Senior Contributor
**
Posts: 111


April 28, 2008, 03:46:52 PM

durian, sorry I can't help you. I set up most of scrub's script by hand trying to get it working in Xfce.

I failed miserably, and just got around to installing fluxbox last night. I downloaded scrub's script after that and it works like a champ.

And let me add my thanks to everyone else's; Thanks scrub!!!

durian, maybe re-backup the stuff that scrub's script overwrites and try it again.

Time to do some surfing in tablet mode....
Logged

#22 Re: Pseudo-mouse & keyboard in tablet mode

mattd
Senior Contributor
**
Posts: 111


April 28, 2008, 04:06:55 PM

Alright, 10min was all I could take without an 'erase' key short cut. I'd love to change the CTL-L (x-button plus check-button) to the 'erase' or backspace key.

I've done a little searching, but I've forgotten where the actual translation takes place.

I think once I figure this out and figure out how exactly you bound mouse movement to the rocker keys, I'll be golden!

Any help?
Logged

#23 Re: Pseudo-mouse & keyboard in tablet mode

孟柯
Commenter

Posts: 11



April 29, 2008, 10:46:06 PM

I should have mentioned that I am still running Sugar. I figured out a work around for my problem, albeit not very elegant, but now I can use the pseudo-mouse and virtual keyboard from tablet mode. First I sugarized xvkbd so I could return back to the keyboard using alt-tab, which allows me to set the focus for typing. Then in /usr/share/sugar/shell/view/keyhandler.py I remapped <ctrl><alt>0xEB to 'next_window', which allows me to cycle through open (sugarized) programs from tablet mode using the 'x' keypad key and the 'rotate' key. (note: this only works after toggling the mousekeys mode and you need to follow the steps explained by scrub and heiman to do that in Sugar) Use the hot frames to navigate to places you can't reach with next_window. I had mine disabled, but re-enabled them now that I use tablet mode more often.

* I also found www.gate2home.com - they have an online virtual keyboard which you can use to type in almost any language. You just need to cut and paste the text, which you can do by selecting (highlighting) the text, moving the cursor to a new field (ie. searchbar) and hitting the 'o' keypad key (now modified to mouse button 2 re: scrub's work)
Logged

#24 Re: Pseudo-mouse & keyboard in tablet mode

孟柯
Commenter

Posts: 11



May 08, 2008, 03:21:58 AM

xvkbd has been acting really flaky lately. ie. disabling they keyboard (and other keys) so I can't <alt>Tab to the next window. When it does let me, it gets 'stuck' so that I can cycle through the programs until I get to xvkbd and then I have to <alt>p to cycle back.

This wouldn't be a problem if I could properly map mod+mouse1, mod+mouse2, etc. Unfortunately I don't know what to name 'mouse1' when editing keyhandler.py. KP_Home (and KP_Next, etc.) can be remapped, but after mousekeys is toggled they have different names.

In the meantime I have been using Greasemonkey (a Firefox add-on https://addons.mozilla.org/en-US/firefox/addon/748) and have installed a virtual keyboard script (http://userscripts.org/scripts/show/10974). It's super easy to use, just double-click on any text field and it pops up! However, it only edits web pages, so you have to copy+paste (or highlight+mouse2) text to the browser and search bars.
Logged

#25 Reposting of file bundle

scrub
Commenter

Posts: 19


December 24, 2008, 05:49:34 PM

My old web host server went down, so I've uploaded the file bundle to a new place:

http://discountpermaculture.com/olpctablet-0.1.zip

Scrub
Logged

#26 Re: Pseudo-mouse & keyboard in tablet mode

orinoco
Commenter

Posts: 13


January 03, 2009, 03:34:20 PM

Hi folks:

I tried to follow these instructions to get some tablet functionality on my XO. I downloaded and installed scrub's script OK. However, when I did the edits to keyhandler.py file as suggested by heiman and restarted sugar, the XO went into a halt in which it would never get to the home screen. I was able to restore the original keyhandler.py file, and am back where I began (still with no tablet functionality).

Any clues as to how to get this done, with buttons and mouse working in tablet mode?

Thanks !
Logged

#27 Re: Pseudo-mouse & keyboard in tablet mode

orinoco
Commenter

Posts: 13


January 09, 2009, 05:40:52 AM

Guys,

I re-followed the instructions and got everything working properly (gamepad controlling the mouse, left and right clicking).

However, for some reason I did not get the onscreen keyboard. Is this still included in scrub's zip file?

Thanks scrub, heiman and everyone else who wrote helpful notes in this post.
Logged

#28 Re: Pseudo-mouse & keyboard in tablet mode

CVK
New

Posts: 4


March 27, 2009, 07:10:49 PM

Hi Guys,

If anyone is still reading this thread...

This looks really great... I think I've almost figured out how to apply this to teapot's Ubuntu port, but I'm a Linux newbie. I think I've found all the mandatory file locations (like rotate_screen.py) Before I go ahead I'm wondering if anyone has tried to apply this to 8.10?  And if you have any recommendations, I'd really appreciate it.

Thank to all!
Logged

#29 Re: Pseudo-mouse & keyboard in tablet mode

phiggins
Commenter

Posts: 16


March 30, 2009, 06:45:21 AM

CVK,

There are at least a couple of us out here who would like to do that on Intrepid.  If you go ahead and it works,  we would be happy to hear how its done. 

Thanks..Paul
Logged
Pages: 1 [2] 3 4
Print
Jump to:  

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