[vox-tech] data-acquisiton question AND xmodmap question

Mark K. Kim vox-tech@lists.lugod.org
Thu, 9 Oct 2003 01:12:02 -0700 (PDT)


On Thu, 9 Oct 2003, Bryan Richter wrote:

> First, I have been wanting to make my escape key toggle between keymaps.
> I have bound ctrl to escape (handy for Vim), so escape is sitting unused
> atm. Since I am not the only person who uses my keyboard, but I *am* the
> only person who uses Dvorak, I would like a quick way of switching back
> and forth. All the info I've found concerning keymappings focuse mainly
> on fixing the insert/delete key business, and nothing mentions binding
> program execution (like 'setxkbmap us') to a keypress.

that might be a window manager feature.  look in your window manager
options, whichever window manager you happen to use.

> The second thing is an old UPS I've inherited that has no way of
> communicating with my computer. It just beeps, which wouldn't be helpful
> when I'm at school. It beeps continuously when reserves are dangerously
> low, and I figured that if I could connect something to the speaker
> circuit, I might be able to use the signal. I'm completely clueless
> here, though, so I'm not asking for any definite answers- I'm just
> wondering if it is possible to use the beep, e.g. wire the speaker to a
> port, and scan for the AC signal that would indicate imminent power
> failure. For all I know, that would fry circuits, but is there
> *something* I could do?

yes.  the parallel port comes to mind.  the serial port should also be
useable.

if i were pursuing this, i'd probably do something like:

   1. tie speaker- to parallel port ground.
   2. tie speaker+ to one of the parallel port inputs via
      some circuit protection circuit...
   3. read the parallel port state from the software...
      i guess ioctl.

note: don't damage anything... obviously.

-Mark

-- 
Mark K. Kim
http://www.cbreak.org/
PGP key available on the website
PGP key fingerprint: 7324 BACA 53AD E504 A76E  5167 6822 94F0 F298 5DCE