Braille Input

One can type braille in Xorg with a mere PC keyboard.

Raw braille input

The first part is making the PC keyboard act as a braille keyboard.

This can be done by using the brai layout, for instance I use the fr layout, and the brai layout in two groups, use the shift-capslock combination to switch between them, and use the scroll-lock LED to tell sighted people what is happening:

setxkbmap -layout fr,brai -options grp:shift_caps_toggle,grp_led:scroll

Or equivalently, in /etc/X11/xorg.conf:

  Section "InputDevice"
     Identifier "Generic Keyboard"
     Driver "kbd"
     Option "XkbLayout"  "fr,brai"
     Option "XkbOptions" "grp:shift_caps_toggle,grp_led:scroll"
  EndSection

The default variant uses the fdsjkla; keys (qwerty notation) or the 41056+ keys. There are also a left_hand variant, using the dsqfvb keys, and a right_hand variant, using the jbnklm keys.

braille to text translation

Only computer braille is supported for now. This can be done by defining a .XCompose file containing e.g.

<braille_dots_1> : "a"
<braille_dots_12> : "b"

BRLTTY is able to produce such kind of table from its own translation tables, for instance:

brltty-ttb -i ttb -o XCompose /etc/brltty/fr-2007.ttb /tmp/XCompose

grade2 could be supported through an xim/scim/whatever module, based e.g. on liblouis to perform the grade2 translation. This is yet TODO.

Magnification

Starting from Xrandr 1.3, Xorg has an integrated way to do completely hardware-based (thus no slowdown at all!) screen magnification by using one or two displays.

Single display

For instance:

$ xrandr
Screen 0: minimum 320 x 200, current 1280 x 1824, maximum 4096 x 4096
VGA1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 330mm x 270mm
   1280x1024      75.0*    60.0  
   1024x768       75.1     70.1     60.0  
   800x600        75.0     60.3  
   640x480        75.0     60.0     59.9  
   720x400        70.1     70.1  

There is one display which can do 640x480 resolution. By running

$ xrandr --fb 1280x1024 --output VGA1 --mode 640x480 --panning 1280x1024

I can make it a 640x480 "window" moving within a 1280x1024 desktop thanks to the mouse.

Dual display

Now I'm lucky, I have two displays:

$ xrandr
Screen 0: minimum 320 x 200, current 1280 x 1824, maximum 4096 x 4096
VGA1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 330mm x 270mm
   1280x1024      75.0*    60.0  
   1024x768       75.1     70.1     60.0  
   800x600        75.0     60.3  
   640x480        75.0     60.0     59.9  
   720x400        70.1     70.1  
LVDS1 connected 1280x800+0+1024 (normal left inverted right x axis y axis) 261mm x 163mm
   1280x800       59.8*+
   1024x768       85.0     75.0     70.1     60.0  
   832x624        74.6  
   800x600        85.1     72.2     75.0     60.3     56.2  
   640x480        85.0     72.8     75.0     59.9  
   720x400        85.0  
   640x400        85.1  
   640x350        85.1

The LVDS1 display can do 640x350, so I can do this:

$ xrandr --fb 1280x1024 --output VGA1 --mode 1280x1024 --output LVDS1 --mode 640x350 --panning 1280x1024

to make the LVDS1 display (here it's the laptop screen) a "window" within the 1280x1024 desktop shown as a whole on the VGA1 display (here it's the external screen).

More modes

640x480 is not so good magnification (about 2x), one can however force using lower modes by adding them to xrandr, for instance 320x200 (about 4x):

$ cvt 320 200
# 320x200 58.96 Hz (CVT 0.06MA) hsync: 12.50 kHz; pclk: 5.00 MHz
Modeline "320x200_60.00"    5.00  320 336 360 400  200 203 209 212 -hsync +vsync

This provides timings for a 320x200 mode, let's add it:

$ xrandr --newmode 320x200 5.00  320 336 360 400  200 203 209 212 -hsync +vsync
$ xrandr --addmode LVDS1 320x200

And now we can use it

$ xrandr --fb 1280x1024 --output LVDS1 --mode 320x200 --panning 1280x1024

Same for 160x100 (8x):

$ cvt 160 100
# 160x100 46.50 Hz (CVT 0.02MA) hsync: 5.21 kHz; pclk: 1.00 MHz
Modeline "160x100_60.00"    1.00  160 168 176 192  100 103 109 112 -hsync +vsync
$ xrandr --newmode 160x100 1.00  160 168 176 192  100 103 109 112 -hsync +vsync
$ xrandr --addmode LVDS1 160x100
$ xrandr --fb 1280x1024 --output LVDS1 --mode 160x100 --panning 1280x1024

(On my machine I'm getting an X error but it actually works).

Keeping the cursor in the middle

It's a bit painful to have to move the mouse to the extremes to get the "window" moving. The border part of the panning option can be used for that:

$ xrandr --fb 1280x1024 --output LVDS1 --mode 160x100 --panning 1280x1024/1280x1024/40/40/40/40

or even

$ xrandr --fb 1280x1024 --output LVDS1 --mode 160x100 --panning 1280x1024/1280x1024/80/50/80/50

Making it easier?

Ideally you should be able to easily setup this. Xorg used to have the [ctrl]-[alt]-[+] and [ctrl]-[alt]-[-] shortcuts to switch between modes. Xorg developers do not consider adding them again and would rather see desktop define their own. Maybe e.g. gnome and KDE should do this? It can be very useful to quickly zoom in, and zoom back out, without having to enable compiz & such.

Notes

With the intel driver, after setting the panning option on some display, I'm unable to unset it. So to get back to my usual dual screen desktop I have to use

$ xrandr --fb 1280x1824 --output VGA1 --mode 1280x1024 --output LVDS1 --mode 1280x800 --panning 1280x800+0+1024

i.e. make the panning limited to the bottom of my desktop, and thus not moving at all.


CategoryGraphical

None: Xorg (last edited 2014-09-12 16:58:12 by SamuelThibault)