Skip to content
Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

Keyboard fun

elbeno, 20 March, 2011

One can have hours of fun with xmodmap. Especially if one has a Symbolics keyboard.

For a start, I get a “real” Meta key (not Alt) and a couple of extra modifier keys that emacs knows about: Hyper and Super. I mapped these to mod2 and mod3. Staying away from mod4 is a good idea because that defaults to the Windows key (on modern keyboards) and there are some Gnome shortcuts that would clash, e.g. show desktop (Windows-d). Modifier 5 is known by xmodmap as Mode_switch, normally mapped to “Alt Gr”.

I learned that a keypress can do 4 things according to the mode it’s in:

  • normal press – type the glyph
  • shift + press – type the shifted glyph
  • mode_switch + press
  • shift + mode_switch + press

The last two of these are outside of normal use, which basically means that you are free to map them to whatever. On the Symbolics keyboard I mapped mode_switch to the Symbol key. Then I had fun making the modmap to make the keys do various things like type Greek letters and mathematical symbols.

I think there’s a reasonably natural mapping between Greek and English letters thus:

  • A – alpha (α)
  • B – beta (β)
  • C – chi (χ)
  • D – delta (δ)
  • E – epsilon (ε)
  • F – phi (φ)
  • G – gamma (γ)
  • H – theta (θ)
  • I – iota (ι)
  • K – kappa (κ)
  • L – lambda (λ)
  • M – mu (μ)
  • N – eta (η)
  • O – omicron (ο)
  • P – pi (π)
  • R – rho (ρ)
  • S – sigma (σ)
  • T – tau (τ)
  • U – upsilon (υ)
  • V – nu (ν)
  • W – omega (ω)
  • X – xi (ξ)
  • Y – psi (ψ)
  • Z – zeta (ζ)

That leaves Q and J free with no obvious Greek letter equivalents. For the number keys, I added some mathematical symbols, and for the punctuation keys I added further punctuation (e.g. left and right guillemots) and things like copyright and trademark symbols.

But that’s not all… I have plans to alter the keyboard firmware (it’s just programmed using C and Teensy – I’ve already made some mods) to use the “Mode Lock” key more extensively. So Mode Lock basically is a hardware shift key, and when it’s on, I can make the entire keyboard send different key codes. Since there are a total of 255 possible keycodes recognisable by xmodmap, I should have room to fit in another complete set (again, 4 per key) and be able to type all sorts of weird and wonderful glyphs.

The only issue I have at the moment is around the keycodes that are in the “numpad zone” on a regular keyboard. The mode_switch doesn’t seem to work with them yet. I still have to figure that out.

Lisp Tinkering

Post navigation

Previous post
Next post

Related Posts

Profiling with SBCL

29 February, 200829 February, 2008

My Bézier curve code was not optimal, so I decided to learn how to profile with SBCL. In particular, I was not yet doing a binary search of the sampled points, neither was I doing an interpolation to recover the parameter t. Finally, I was sampling the curve at a…

Read More

More on ellipses

1 March, 20081 March, 2008

I think I will use the same method as I do for Bézier curves to step along the circumference. Another generalisation I had to make from the circle code is with respect to the normal. For a circle of radius r, centred on the origin, and parameterised by angle θ,…

Read More

Experimenting with (cubic) Bézier subdivision

27 February, 20081 March, 2008

As you know, a Bézier curve (here meaning specifically a cubic Bézier) is often used for drawing all kinds of things in vector graphics. It has the nice property that the endpoints and control points form a bounding box, and deCasteljau’s algorithm is a nice numerically stable way of evaluating…

Read More

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

©2026 Why is a raven like a writing desk? | WordPress Theme by SuperbThemes