[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UTF-8 keyboard mode



    From: Frank da Cruz <fdc@watsun.cc.columbia.edu>

    Also I think an application needs to be able to find out the keyboard mode
    (so it can save and restore it)

When reading from /dev/kbd this need disappears.
Otherwise, the ioctl exist already. (KDGKBMODE)

    and also needs to be able to find out if
    it actually does have access to the PC's keyboard.

Yes, also a well-known need. For the kbd package I solved it by creating
a function getfd() that opens a handful of plausible things and test whether
these things are PC keyboards. The testing is by trying an ioctl that is
only valid on keyboards. The plausible things are file descriptors 0,1,2,
and files /dev/tty and /dev/console, if I recall correctly.

Andries
-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/lists/