个人工具

UbuntuHelp:Accessibility/OnboardAndMousetweaksAtGDM

来自Ubuntu中文

跳转至: 导航, 搜索

Onboard and MouseTweaks during GDM

Introduction

People using Ubuntu 7.10 or a more recent version of Ubuntu, can set up a way to start the onscreen keyboard named onboard during their GDM session. Moreover, if they cannot click with a hardware button, they can also set up a way to start mousetweaks in their GDM session. (Mousetweaks is a program that issues automatic clicks without the user pressing any mouse button; this fonctionality is usually called dwell click.) Please, have a look at the following picture to see onboard and mousetweaks run alongside the Plain interface (also called greeter) of GDM: OnboardAndMousetweaksAtGDM?action=AttachFile&do=get&target=GDMLoginWithOnboardAndDwelling.png Remark: It is currently not possible to use applications that show a graphical user interface with the themed greeter; but it possible to use them with the plain greeter. Consequently, the following will only work with the plain greeter. Remark2: I have filed the following Request For Enhancement bug to make onboard and mousetweaks also available for the themed greeter: https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/130368

Install Mousetweaks and an updated version of onboard

Note: If you are using Ubuntu 8.04, you should skip this step. In fact, the default installation of Ubuntu 8.04 already contains versions of onboard and mousetweaks that are appropriate to be used during GDM. For this to work, you need onboard version 0.88 or above, but Ubuntu 7.10 comes with version 0.87. Moreover, Mousetweaks does not yet ship with Ubuntu 7.10. So, you have to install both softwares, if you want to use both. You can install them with the Synaptic Package Manager, once you have added new entries to the Software Sources preferences. Please continue reading for more details about how to proceed:

Onboard

The author of onboard was so kind to provide a Personal Package Archive (PPA) from which you can install onboard 0.88 for the i386 and amd64 architectures. In order to use it, do the following: Open the Software Sources preferences (which is located in the menu System->Administration), choose the Third Party Software tab, click on the Add... button, paste the following line into the APT Line field and confirm it by clicking on the Add Source button:

deb     http://ppa.launchpad.net/onboard/ubuntu gutsy main restricted universe multiverse

Then, do the same to also add the following entry to the Software Sources:

deb-src     http://ppa.launchpad.net/onboard/ubuntu gutsy main restricted universe multiverse

After closing the Software Sources preferences, you can use the Synaptic Package Manager to install onboard 0.88~ppa in the same way you do it for other software. Please, install it By the way, onboard is hosted on Launchpad: https://launchpad.net/onboard OnboardAndMousetweaksAtGDM?action=AttachFile&do=get&target=SoftwareSources.png

MouseTweaks

Mousetweaks is a new utility whose implementation has begun this summer as a GSoC 2007 project for Ubuntu by Gerd Kohlberger. It is not part of the repositories of Ubuntu 7.10 yet; but it is planned to become part of it. For the meantime, I have prepared a Personal Package Archive to make its installation easier for Ubuntu users with i386 and amd64 architectures. After adding the following 2 entries to the Software Sources, Mousetweaks will also be available for installation by the Synaptic Package Manager.

deb     http://ppa.launchpad.net/frafu/ubuntu gutsy main restricted universe multiverse
deb-src     http://ppa.launchpad.net/frafu/ubuntu gutsy main restricted universe multiverse

Please, install it. By the way, the Mousetweaks project is hosted on launchpad under the following link: https://launchpad.net/mousetweaks/

Add new gestures to GDM in order to start onboard and mousetweaks

If the Accessibility features are enabled for the Login Window, the plain greeter steadily monitors the movement of the pointer in the background. When it recognises a gesture that has been defined in the gesture configuration file, it starts the application associated with that gesture:

Add the gesture to start onboard to the gesture configuration file

Open a terminal and type the following to open the gesture configuration file:

gksudo gedit /etc/gdm/modules/AccessDwellMouseEvents

The following line defines a new the gesture and associates it to onboard:

RBLT I 10000	/usr/bin/onboard --size 500x180 -x 20 -y 10

Please add it above the following line that is already in the gesture configuration file:

TBLR I 10000    /usr/bin/gok --login --access-method=directselection

Save and close gedit.

Add the gesture to start mousetweaks to the gesture configuration file

Similar to onboard, the following line defines another new gesture and associates it to mousetweaks. Please add it to the gesture configuration file; right below the line for onboard:

RTLB I 10000	/usr/bin/mousetweaks --enable dwell --dwell-mode window --show-ctw --ctw-x 550 --ctw-y 10

Remark

  • 500x180: 500 is the width of onboard and 180 is the height of onboard. You can change the values of these numbers if you want to change the size of onboard. This might be useful depending on the resolution of your GDM screen.
  • -x 20 -y 10 is the position of the upper left corner of onboard. By editing these numbers (not the letters), you can change the position of onboard on the screen.
  • --ctw-x 550 --ctw-y 10 determines the position of the upper left corner of the window from mousetweaks on the screen. By editing these numbers (not the words), you can change the position of mousetweaks on the screen.

Enable Assistive Technology and Set Plain Theme in GDM

For GDM to monitor the pointer for gestures, you have to configure it to use its plain greeter and enable the accessibility features. The Login Window under the menu System->Administration of the normal gnome session allows you to perform the appropriate configuration.

  • First enable Assistive Technology in the Accessibility tab of the Login Window:

OnboardAndMousetweaksAtGDM?action=AttachFile&do=get&target=LoginWindowAccessibilityTab.png

  • Unfortunately, the accessibility features do not work with the default gdm-theme used by Ubuntu. You have to set gdm to use its Plain theme in the Style menu under the Local tab:

OnboardAndMousetweaksAtGDM?action=AttachFile&do=get&target=LoginWindowLocalTab.png

How to start onboard during GDM

During the GDM session, a background process steadily monitors the pointer to detect determined gestures that are associated with specific programs. On the following picture you can see the gesture that the pointer has to perform in order to start of onboard: OnboardAndMousetweaksAtGDM?action=AttachFile&do=get&target=gdmlogin-onboard-gesture.png What matters in the gesture, is:

  • what edges of the GDM window are crossed
  • the sequence of the crossed edges
  • if the first edge is crossed from the outside to the inside, or from the inside to the outside
  • no more than 10 seconds must elapse between the crossing of one edge and the crossing of the next edge
  • it does not matter if the pointer moves in straight lines (like in the sample above) or in curves; the only thing that matters is the edge crossing

For onboard this means:

  • the pointer has to begin by crossing the right edge of the GDM window from the outside to the inside
  • then it has to cross the bottom edge from the inside to the outside
  • then it has to cross the left edge from the outside to the inside
  • finally it has to cross the top edge from the inside to the outside

If no more than 10 seconds elapse between two consecutive edge crossings, onboard will appear at the top-left of the screen.

How to start mousetweaks during GDM

It is also possible to start dwelling with a gesture during the GDM session. (provided the gesture has been defined, that Assistive Technology has been enabled for GDM, and that the Plain theme is used) Gesture to start mousetweaks for dwelling: OnboardAndMousetweaksAtGDM?action=AttachFile&do=get&target=gdmlogin-mousetweaks-gesture.png For explanations about how to interprete this picture, please have a look at the Starting of onboard above.

Notes

  • To stop gdm you can type:
/etc/init.d/gdm stop 

To restart them use:

cd /etc/init.d 

and select gdm

  • The default display manager is selected in /etc/X11/default-display-manager