diff options
Diffstat (limited to 'hw/xfree86/os-support/solaris/sun_kbd.c')
-rw-r--r-- | hw/xfree86/os-support/solaris/sun_kbd.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/hw/xfree86/os-support/solaris/sun_kbd.c b/hw/xfree86/os-support/solaris/sun_kbd.c index 7e4998817..a48b7f176 100644 --- a/hw/xfree86/os-support/solaris/sun_kbd.c +++ b/hw/xfree86/os-support/solaris/sun_kbd.c @@ -23,12 +23,15 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* $XdotOrg:$ */ +#include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" static int sun_otranslation = -1; static int sun_odirect = -1; +int sun_ktype; int xf86GetKbdLeds() @@ -53,7 +56,8 @@ xf86SetKbdRepeat(char rad) void xf86KbdInit() { - int ktype, klayout; + int klayout; + const char *ktype_name; if (xf86Info.kbdFd < 0) { xf86Info.kbdFd = open("/dev/kbd", O_RDWR|O_NONBLOCK); @@ -62,11 +66,11 @@ xf86KbdInit() } /* - * None of the followin should ever fail. If it does, something is + * None of the following should ever fail. If it does, something is * broken (IMO) - DWH 8/21/99 */ - if (ioctl(xf86Info.kbdFd, KIOCTYPE, &ktype) < 0) + if (ioctl(xf86Info.kbdFd, KIOCTYPE, &sun_ktype) < 0) FatalError("Unable to determine keyboard type: %d\n", errno); if (ioctl(xf86Info.kbdFd, KIOCLAYOUT, &klayout) < 0) @@ -77,6 +81,21 @@ xf86KbdInit() if (ioctl(xf86Info.kbdFd, KIOCGDIRECT, &sun_odirect) < 0) FatalError("Unable to determine keyboard direct setting\n"); + + switch (sun_ktype) { + case KB_SUN3: + ktype_name = "Sun Type 3"; break; + case KB_SUN4: + ktype_name = "Sun Type 4/5/6"; break; + case KB_USB: + ktype_name = "USB"; break; + case KB_PC: + ktype_name = "PC"; break; + default: + ktype_name = "Unknown"; break; + } + xf86Msg(X_PROBED, "Keyboard type: %s (%d)\n", ktype_name, sun_ktype); + xf86Msg(X_PROBED, "Keyboard layout: %d\n", klayout); } int |