*

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 58008 times)

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

CVK
New

Posts: 4


March 31, 2009, 12:45:00 AM

Hi Paul,

I think I almost have it, but I can't find the keybinding file in 8.10. Nothing I've found so far looks like the .fluxbox/keys file that Scrub modded.  It's the only major hold up so far, but I'm gonna keep at it.  Any ideas?

Thanks for the response!
Logged

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

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


March 31, 2009, 11:16:22 AM

The equivalent to the Fluxbox "keys" file in XFCE is the ".xbindkeysrc" in your home directory. However the syntax is different. To toggle key behavior for example, instead of:
235 :ExecCommand /usr/bin/togglemousekeys.sh
you should have:
"togglemousekeys.sh"
 c:235

I hope this helps a bit

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 )

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

CVK
New

Posts: 4


March 31, 2009, 12:15:46 PM

The equivalent to the Fluxbox "keys" file in XFCE is the ".xbindkeysrc" in your home directory. However the syntax is different. To toggle key behavior for example, instead of:
235 :ExecCommand /usr/bin/togglemousekeys.sh
you should have:
"togglemousekeys.sh"
 c:235

I hope this helps a bit



This helps so much! I found the ".xbindkeysrc" but wasn't sure.  Thanks for the syntax, I think I can do it now... I'm gonna back up my system on another SD card and then start adding the commands. If it works I'll post the install procedure.
Logged

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

phiggins
Commenter

Posts: 16


April 01, 2009, 04:42:17 AM

CVK,

I found an easy way in Intrepid to turn on the arrow keys to control the pointer:

Click the Appications icon...Settings...Settings Manager..Mouse..Accessibility..Enable mouse emulation..Close ..OK
You may have to play around with the Delay and Interval to get the cursor to move properly.

You then need a click button so I followed the original instructions on page 1 to make the square button on the leftside of the screen a "click":

cd /usr/share/X11/xkb/compat
vim mousekeys (or use whatever text editor you prefer) to change this text:

    interpret Pointer_Button1 {
        action= PointerButton(button=1);
    };
to instead say:

    interpret KP_Home{
        action= PointerButton(button=1);
    };

Then had to restart to make that work.

It doesn't give me a keyboard when in tablet mode but for my application I really can get by most of the time with just the cursor controls  and click button.

Paul


Logged

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

phiggins
Commenter

Posts: 16


April 02, 2009, 02:36:01 AM

I found a on-screen keyboard that works with Ubuntu Intrepid to install:
sudo apt-get install gtkeyboard

How to run the program?
From Ubuntu Terminal screen (Applications > Accessories > Terminal), type: gtkeyboard

Manual: http://www.gnu.org/software/gtkeyboard/MANUAL.html

Unfortunately it doesn't work for Wine programs like SeaClear which is the one I want it for.  But you can turn on Double Output and then Cut the text from the Text Editing Buffer and paste into the application Window that is running under Wine.  Now to figure out how to highlite text for Cut without using a mouse.

Logged

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

phiggins
Commenter

Posts: 16


April 02, 2009, 03:27:05 AM

I should have tried the on screen keyboard xvkbd mentioned on page 1 first . I installed it by issuing:
sudo apt-get install xvkbd

It works with Wine and SeaClear!

Paul
Logged

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

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


April 02, 2009, 09:25:01 AM

I'm trying to right  small script that will toggle  "enable mouse emulation" in the mouse control panel and bring up the virtual keyboard in response to screen rotation button. in combination with the modified "mousekeys" should make a more functional tablet mode in Ubuntu.
Although I looked wherever I could think of I can not find a terminal command (or script) that will do the emulation on/off in XFCE4/Ubuntu.
Is there one?
Any ideas?
« Last Edit: April 02, 2009, 12:51:51 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 )

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

phiggins
Commenter

Posts: 16


April 02, 2009, 12:16:35 PM

OK I seem to have it working. I use the rotate button to turn on screen arrow keys on the left  of the screen  to control the cursor movement.  Thus the rotate button does not rotate the screen which I find useless anyway.  I also have the buttons on the right (the square button, the circle and the check  defined as a click. If I press the X key and the square button it toggles the keyboard off and on.

I found that once you turn the arrow keys on,  if you don't use the keys for a few minutes, they stop working.  I don't know why but all I have to do to reactivate them is press the rotate button.

Seems to do everything I need without having a keyboard or a mouse.

Paul
Logged

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

Kerry
Commenter

Posts: 16


April 02, 2009, 12:48:24 PM

Paul and others,
Thanks for all your work on this, I want to use my XO for navigation on my boat, and this will be an important feature in making it all work.
      Kerry
Logged

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

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


April 02, 2009, 12:55:06 PM

I use the rotate button to turn on screen arrow keys on the left  of the screen  to control the cursor movement.

How?

Edit Never mind.
Here is what I did. It turns out that Scrub's script need the line
#!/bin/bash
in the begining to be executed in XFCE.
so I modified the   /usr/bin/togglemousekeys.sh to look like that
Quote
#!/bin/bash
current=`xrandr | grep connected | awk '{print $4}'`
if [ $current == "(normal" ]; then val=0
  elif [ $current == "left" ]; then val=1
  elif [ $current == "inverted" ]; then val=2
  elif [ $current == "right" ]; then val=3
fi

current=`xkbset q | grep "Mouse-Keys =" | awk '{print $3}'`
if [ $current == "Off" ]; then
  xkbset m -r ma 60 20 25 30 500
  state=1
  xvkbd -geometry 400x130-10-10
else
  xkbset -m r
  state=0
  killall xvkbd
fi

xmodmap /home/olpc/.tablet/state${state}_rotate${val}

Notice the xvkbd related additional lines. If you do not want the virtual keyboard popping out every time you go to tablet mode delete them

Then edit the /home/olpc/.xbindkeysrc to rotate the screen by shift+rotation button  and  toggle keys with the rotation button (is towards the end of the file)
Quote
# rotate screen
"rotate_screen.py /etc/rotate_screen/olpckeys"
 shift + c:235

# tggle mouse keys plus xvkbd
"togglemousekeys.sh"
 c:235
So you now have button navigation and virtual keyboard in tablet mode in Xfce/Ubuntu. Rotation though still needs the keyboard
« Last Edit: April 02, 2009, 04:14:56 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 )

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

phiggins
Commenter

Posts: 16


April 02, 2009, 04:16:07 PM

Yes it took me awhile to figiure out it needed the #!/bin/bash

Here is how I defined in the .xbindkeysrc

# bind the mousekeys toggle to the screen rotate key
"togglemousekeys.sh"
 c:235

# bind the X key + Square key (Control+Alt+Mouse1) to toggle the on-screen keyboard
"togglevkbd.sh"
 Control + Alt + b:1


As I said ,rotating that screen is worthless to me.
Logged

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

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


April 03, 2009, 12:22:19 AM

As I said ,rotating that screen is worthless to me.

Right.
But is good to have the option. Scrub's rotation script do not work in Ubuntu but Teapot's does. And changing the rotation button definition in .xbindkeysrc from
# rotate screen
"rotate_screen.py /etc/rotate_screen/olpckeys"
 c:235
to
# rotate screen
"rotate_screen.py /etc/rotate_screen/olpckeys"
contol + alt + c:235
makes it work also in tablet mode by pressing the X game key and the rotate button (was too late last night to think of it... Smiley )

So for future reference:
to get tablet mode working in Ubuntu 8.10/xfce
1) Install  xvkbd, xkbset and xaw3d with synaptic or apt-get
2) Download and install Scrub's scripts and modifications (previous page). Before you run the "install.sh" script open it with a text editor and remove the first (yum install Xaw3d) line. You have done it already, and you should have installed yum in your Ubuntu to run it. Note also that the "fluxbox" folder is not needed if you do not use fluxbox. If you do, place the included "keys" file in your ".fluxbox" directory in your home folder.
3) Modify with your favorite text editor and sudo privileges, the togglemousekeys.sh and togglevkbd.sh scripts in /usr/bin to contain #!/bin/bash as the first line (you can do the same for xrandr_reverse.sh and xrandr_rotate.sh but they do not appear to work in XFCE)
4) Modify the .xbindkeysrc in your home directory according to this and the Phiggins' post just above (thx) or in any other way that suit your needs.
5) Restart XFCE and enjoy

Starting you have the expected game button behavior (but the screen-rotate button). Pressing the screen-rotate button you can now move the mouse with the rocker keys on the left while the game keys on the right are the 3 mouse buttons and the (bottom) "X" game key is the ctrl+alt command. While in this mode, pressing the "X" and the "square" game keys brings up a virtual keyboard. Pressing again is going away.
Pressing the rotate button again you return to the standard button function.
To rotate the screen you need to press ctrl+alt+screen-rotate button or the "X" game key and the screen-rotate button while in tablet mode.

PS: If you intend to use the virtual keyboard while in the portrait screen layout, when you modify the togglevkbd.sh script change also the penultimate line to /usr/bin/xvkbd -secure -always-on-top -compact -geometry 300x80+550-30 otherwise your keyboard will be off the screen.
« Last Edit: April 03, 2009, 01:33:29 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 )

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

phiggins
Commenter

Posts: 16


April 03, 2009, 01:28:44 AM

Good idea mavrothal  about using CtrL + Alt + the rotate button.

One thing I want to confirm if you have the same problem:  while in tablet-mode if you don't use the screen keys for a few minutes,  it drops out of tablet mode.  Do you also experience this?  Do you think its a bug or is there some parameter somewhere to make it stay? 

Thanks
Logged

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

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


April 03, 2009, 01:38:08 AM

One thing I want to confirm if you have the same problem:  while in tablet-mode if you don't use the screen keys for a few minutes,  it drops out of tablet mode.  Do you also experience this?  Do you think its a bug or is there some parameter somewhere to make it stay? 
I'll check when I have the chance but just a thought. Do you have aggressive power management on? I'm not sure if it will recover to the same mode.
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 )

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

phiggins
Commenter

Posts: 16


April 03, 2009, 02:07:36 AM

The Display Power management is not on.  Is there some other power management?
Logged
Pages: 1 2 [3] 4
Print
Jump to:  

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