sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-08-28 05:57:34 +00:00
commit 88965415ff
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
26235 changed files with 29195616 additions and 0 deletions

View file

@ -0,0 +1,45 @@
# Copyright 2005 Adam Jackson.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS) $(OS_FLAGS)
kbd_drv_la_LTLIBRARIES = kbd_drv.la
kbd_drv_la_LDFLAGS = -avoid-version -module
kbd_drv_la_SOURCES = kbd.c xf86OSKbd.h xf86Keymap.h atKeynames.h
kbd_drv_la_LIBADD = $(XORG_LIBS)
kbd_drv_ladir = @inputdir@
BSD_SRCS = bsd_KbdMap.c bsd_kbd.c bsd_kbd.h at_scancode.c
HURD_SRCS = hurd_kbd.c at_scancode.c
SOLARIS_SRCS = sun_kbd.c sun_kbd.h sun_kbdMap.c
if BSD
kbd_drv_la_SOURCES += $(BSD_SRCS)
endif
if SOLARIS
kbd_drv_la_SOURCES += $(SOLARIS_SRCS)
endif
if HURD
kbd_drv_la_SOURCES += $(HURD_SRCS)
endif
EXTRA_DIST = $(BSD_SRCS) $(HURD_SRCS) $(SOLARIS_SRCS)

View file

@ -0,0 +1,671 @@
# Makefile.in generated by automake 1.12.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# Copyright 2005 Adam Jackson.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@BSD_TRUE@am__append_1 = $(BSD_SRCS)
@SOLARIS_TRUE@am__append_2 = $(SOLARIS_SRCS)
@HURD_TRUE@am__append_3 = $(HURD_SRCS)
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(kbd_drv_ladir)"
LTLIBRARIES = $(kbd_drv_la_LTLIBRARIES)
am__DEPENDENCIES_1 =
kbd_drv_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am__kbd_drv_la_SOURCES_DIST = kbd.c xf86OSKbd.h xf86Keymap.h \
atKeynames.h bsd_KbdMap.c bsd_kbd.c bsd_kbd.h at_scancode.c \
sun_kbd.c sun_kbd.h sun_kbdMap.c hurd_kbd.c
am__objects_1 = bsd_KbdMap.lo bsd_kbd.lo at_scancode.lo
@BSD_TRUE@am__objects_2 = $(am__objects_1)
am__objects_3 = sun_kbd.lo sun_kbdMap.lo
@SOLARIS_TRUE@am__objects_4 = $(am__objects_3)
am__objects_5 = hurd_kbd.lo at_scancode.lo
@HURD_TRUE@am__objects_6 = $(am__objects_5)
am_kbd_drv_la_OBJECTS = kbd.lo $(am__objects_2) $(am__objects_4) \
$(am__objects_6)
kbd_drv_la_OBJECTS = $(am_kbd_drv_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
kbd_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(kbd_drv_la_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(kbd_drv_la_SOURCES)
DIST_SOURCES = $(am__kbd_drv_la_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
DRIVER_NAME = @DRIVER_NAME@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_FLAGS = @OS_FLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
VERSION = @VERSION@
XORG_CFLAGS = @XORG_CFLAGS@
XORG_LIBS = @XORG_LIBS@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
inputdir = @inputdir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS) $(OS_FLAGS)
kbd_drv_la_LTLIBRARIES = kbd_drv.la
kbd_drv_la_LDFLAGS = -avoid-version -module
kbd_drv_la_SOURCES = kbd.c xf86OSKbd.h xf86Keymap.h atKeynames.h \
$(am__append_1) $(am__append_2) $(am__append_3)
kbd_drv_la_LIBADD = $(XORG_LIBS)
kbd_drv_ladir = @inputdir@
BSD_SRCS = bsd_KbdMap.c bsd_kbd.c bsd_kbd.h at_scancode.c
HURD_SRCS = hurd_kbd.c at_scancode.c
SOLARIS_SRCS = sun_kbd.c sun_kbd.h sun_kbdMap.c
EXTRA_DIST = $(BSD_SRCS) $(HURD_SRCS) $(SOLARIS_SRCS)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-kbd_drv_laLTLIBRARIES: $(kbd_drv_la_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(kbd_drv_la_LTLIBRARIES)'; test -n "$(kbd_drv_ladir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(kbd_drv_ladir)'"; \
$(MKDIR_P) "$(DESTDIR)$(kbd_drv_ladir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(kbd_drv_ladir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(kbd_drv_ladir)"; \
}
uninstall-kbd_drv_laLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(kbd_drv_la_LTLIBRARIES)'; test -n "$(kbd_drv_ladir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(kbd_drv_ladir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(kbd_drv_ladir)/$$f"; \
done
clean-kbd_drv_laLTLIBRARIES:
-test -z "$(kbd_drv_la_LTLIBRARIES)" || rm -f $(kbd_drv_la_LTLIBRARIES)
@list='$(kbd_drv_la_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
kbd_drv.la: $(kbd_drv_la_OBJECTS) $(kbd_drv_la_DEPENDENCIES) $(EXTRA_kbd_drv_la_DEPENDENCIES)
$(AM_V_CCLD)$(kbd_drv_la_LINK) -rpath $(kbd_drv_ladir) $(kbd_drv_la_OBJECTS) $(kbd_drv_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/at_scancode.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_KbdMap.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_kbd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hurd_kbd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kbd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_kbd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sun_kbdMap.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(kbd_drv_ladir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-kbd_drv_laLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-kbd_drv_laLTLIBRARIES
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-kbd_drv_laLTLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-kbd_drv_laLTLIBRARIES clean-libtool cscopelist ctags \
distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-kbd_drv_laLTLIBRARIES install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags uninstall uninstall-am \
uninstall-kbd_drv_laLTLIBRARIES
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View file

@ -0,0 +1,297 @@
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Thomas Roell not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Thomas Roell makes no representations
* about the suitability of this software for any purpose. It is provided
* "as is" without express or implied warranty.
*
* THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* Copyright (c) 1994-2003 by The XFree86 Project, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of the copyright holder(s)
* and author(s) shall not be used in advertising or otherwise to promote
* the sale, use or other dealings in this Software without prior written
* authorization from the copyright holder(s) and author(s).
*/
#ifndef _ATKEYNAMES_H
#define _ATKEYNAMES_H
#define XK_TECHNICAL
#define XK_KATAKANA
#include <X11/keysym.h>
#include <X11/XF86keysym.h>
#define GLYPHS_PER_KEY 4
#define NUM_KEYCODES 248
#define MIN_KEYCODE 8
#define MAX_KEYCODE (NUM_KEYCODES + MIN_KEYCODE - 1)
#define AltMask Mod1Mask
#define NumLockMask Mod2Mask
#define AltLangMask Mod3Mask
#define KanaMask Mod4Mask
#define ScrollLockMask Mod5Mask
#define KeyPressed(k) (keyc->postdown[k >> 3] & (1 << (k & 7)))
#define ModifierDown(k) ((keyc->state & (k)) == (k))
/*
* NOTE: The AT/MF keyboards can generate (via the 8042) two (MF: three)
* sets of scancodes. Set3 can only be generated by a MF keyboard.
* Set2 sends a makecode for keypress, and the same code prefixed by a
* F0 for keyrelease. This is a little bit ugly to handle. Thus we use
* here for X386 the PC/XT compatible Set1. This set uses 8bit scancodes.
* Bit 7 is set if the key is released. The code E0 switches to a
* different meaning to add the new MF cursorkeys, while not breaking old
* applications. E1 is another special prefix. Since I assume that there
* will be further versions of PC/XT scancode compatible keyboards, we
* may be in trouble one day.
*
* IDEA: 1) Use Set2 on AT84 keyboards and translate it to MF Set3.
* 2) Use the keyboards native set and translate it to common keysyms.
*/
/*
* definition of the AT84/MF101/MF102 Keyboard:
* ============================================================
* Defined Key Cap Glyphs Pressed value
* Key Name Main Also (hex) (dec)
* ---------------- ---------- ------- ------ ------
*/
#define KEY_Escape /* Escape 0x01 */ 1
#define KEY_1 /* 1 ! 0x02 */ 2
#define KEY_2 /* 2 @ 0x03 */ 3
#define KEY_3 /* 3 # 0x04 */ 4
#define KEY_4 /* 4 $ 0x05 */ 5
#define KEY_5 /* 5 % 0x06 */ 6
#define KEY_6 /* 6 ^ 0x07 */ 7
#define KEY_7 /* 7 & 0x08 */ 8
#define KEY_8 /* 8 * 0x09 */ 9
#define KEY_9 /* 9 ( 0x0a */ 10
#define KEY_0 /* 0 ) 0x0b */ 11
#define KEY_Minus /* - (Minus) _ (Under) 0x0c */ 12
#define KEY_Equal /* = (Equal) + 0x0d */ 13
#define KEY_BackSpace /* Back Space 0x0e */ 14
#define KEY_Tab /* Tab 0x0f */ 15
#define KEY_Q /* Q 0x10 */ 16
#define KEY_W /* W 0x11 */ 17
#define KEY_E /* E 0x12 */ 18
#define KEY_R /* R 0x13 */ 19
#define KEY_T /* T 0x14 */ 20
#define KEY_Y /* Y 0x15 */ 21
#define KEY_U /* U 0x16 */ 22
#define KEY_I /* I 0x17 */ 23
#define KEY_O /* O 0x18 */ 24
#define KEY_P /* P 0x19 */ 25
#define KEY_LBrace /* [ { 0x1a */ 26
#define KEY_RBrace /* ] } 0x1b */ 27
#define KEY_Enter /* Enter 0x1c */ 28
#define KEY_LCtrl /* Ctrl(left) 0x1d */ 29
#define KEY_A /* A 0x1e */ 30
#define KEY_S /* S 0x1f */ 31
#define KEY_D /* D 0x20 */ 32
#define KEY_F /* F 0x21 */ 33
#define KEY_G /* G 0x22 */ 34
#define KEY_H /* H 0x23 */ 35
#define KEY_J /* J 0x24 */ 36
#define KEY_K /* K 0x25 */ 37
#define KEY_L /* L 0x26 */ 38
#define KEY_SemiColon /* ;(SemiColon) :(Colon) 0x27 */ 39
#define KEY_Quote /* ' (Apostr) " (Quote) 0x28 */ 40
#define KEY_Tilde /* ` (Accent) ~ (Tilde) 0x29 */ 41
#define KEY_ShiftL /* Shift(left) 0x2a */ 42
#define KEY_BSlash /* \(BckSlash) |(VertBar)0x2b */ 43
#define KEY_Z /* Z 0x2c */ 44
#define KEY_X /* X 0x2d */ 45
#define KEY_C /* C 0x2e */ 46
#define KEY_V /* V 0x2f */ 47
#define KEY_B /* B 0x30 */ 48
#define KEY_N /* N 0x31 */ 49
#define KEY_M /* M 0x32 */ 50
#define KEY_Comma /* , (Comma) < (Less) 0x33 */ 51
#define KEY_Period /* . (Period) >(Greater)0x34 */ 52
#define KEY_Slash /* / (Slash) ? 0x35 */ 53
#define KEY_ShiftR /* Shift(right) 0x36 */ 54
#define KEY_KP_Multiply /* * 0x37 */ 55
#define KEY_Alt /* Alt(left) 0x38 */ 56
#define KEY_Space /* (SpaceBar) 0x39 */ 57
#define KEY_CapsLock /* CapsLock 0x3a */ 58
#define KEY_F1 /* F1 0x3b */ 59
#define KEY_F2 /* F2 0x3c */ 60
#define KEY_F3 /* F3 0x3d */ 61
#define KEY_F4 /* F4 0x3e */ 62
#define KEY_F5 /* F5 0x3f */ 63
#define KEY_F6 /* F6 0x40 */ 64
#define KEY_F7 /* F7 0x41 */ 65
#define KEY_F8 /* F8 0x42 */ 66
#define KEY_F9 /* F9 0x43 */ 67
#define KEY_F10 /* F10 0x44 */ 68
#define KEY_NumLock /* NumLock 0x45 */ 69
#define KEY_ScrollLock /* ScrollLock 0x46 */ 70
#define KEY_KP_7 /* 7 Home 0x47 */ 71
#define KEY_KP_8 /* 8 Up 0x48 */ 72
#define KEY_KP_9 /* 9 PgUp 0x49 */ 73
#define KEY_KP_Minus /* - (Minus) 0x4a */ 74
#define KEY_KP_4 /* 4 Left 0x4b */ 75
#define KEY_KP_5 /* 5 0x4c */ 76
#define KEY_KP_6 /* 6 Right 0x4d */ 77
#define KEY_KP_Plus /* + (Plus) 0x4e */ 78
#define KEY_KP_1 /* 1 End 0x4f */ 79
#define KEY_KP_2 /* 2 Down 0x50 */ 80
#define KEY_KP_3 /* 3 PgDown 0x51 */ 81
#define KEY_KP_0 /* 0 Insert 0x52 */ 82
#define KEY_KP_Decimal /* . (Decimal) Delete 0x53 */ 83
#define KEY_SysReqest /* SysReqest 0x54 */ 84
/* NOTUSED 0x55 */
#define KEY_Less /* < (Less) >(Greater) 0x56 */ 86
#define KEY_F11 /* F11 0x57 */ 87
#define KEY_F12 /* F12 0x58 */ 88
#define KEY_Prefix0 /* special 0x60 */ 96
#define KEY_Prefix1 /* special 0x61 */ 97
/*
* The 'scancodes' below are generated by the server, because the MF101/102
* keyboard sends them as sequence of other scancodes
*/
#define KEY_Home /* Home 0x59 */ 89
#define KEY_Up /* Up 0x5a */ 90
#define KEY_PgUp /* PgUp 0x5b */ 91
#define KEY_Left /* Left 0x5c */ 92
#define KEY_Begin /* Begin 0x5d */ 93
#define KEY_Right /* Right 0x5e */ 94
#define KEY_End /* End 0x5f */ 95
#define KEY_Down /* Down 0x60 */ 96
#define KEY_PgDown /* PgDown 0x61 */ 97
#define KEY_Insert /* Insert 0x62 */ 98
#define KEY_Delete /* Delete 0x63 */ 99
#define KEY_KP_Enter /* Enter 0x64 */ 100
#define KEY_RCtrl /* Ctrl(right) 0x65 */ 101
#define KEY_Pause /* Pause 0x66 */ 102
#define KEY_Print /* Print 0x67 */ 103
#define KEY_KP_Divide /* Divide 0x68 */ 104
#define KEY_AltLang /* AtlLang(right) 0x69 */ 105
#define KEY_Break /* Break 0x6a */ 106
#define KEY_LMeta /* Left Meta 0x6b */ 107
#define KEY_RMeta /* Right Meta 0x6c */ 108
#define KEY_Menu /* Menu 0x6d */ 109
#define KEY_F13 /* F13 0x6e */ 110
#define KEY_F14 /* F14 0x6f */ 111
#define KEY_F15 /* F15 0x70 */ 112
#define KEY_HKTG /* Hirugana/Katakana tog 0x70 */ 112
#define KEY_F16 /* F16 0x71 */ 113
#define KEY_F17 /* F17 0x72 */ 114
#define KEY_KP_DEC /* KP_DEC 0x73 */ 115
#define KEY_BSlash2 /* \ _ 0x73 */ 115
#define KEY_KP_Equal /* Equal (Keypad) 0x76 */ 118
#define KEY_XFER /* Kanji Transfer 0x79 */ 121
#define KEY_NFER /* No Kanji Transfer 0x7b */ 123
#define KEY_Yen /* Yen 0x7d */ 125
#define KEY_Power /* Power Key 0x84 */ 132
#define KEY_Mute /* Audio Mute 0x85 */ 133
#define KEY_AudioLower /* Audio Lower 0x86 */ 134
#define KEY_AudioRaise /* Audio Raise 0x87 */ 135
#define KEY_Help /* Help 0x88 */ 136
#define KEY_L1 /* Stop 0x89 */ 137
#define KEY_L2 /* Again 0x8a */ 138
#define KEY_L3 /* Props 0x8b */ 139
#define KEY_L4 /* Undo 0x8c */ 140
#define KEY_L5 /* Front 0x8d */ 141
#define KEY_L6 /* Copy 0x8e */ 142
#define KEY_L7 /* Open 0x8f */ 143
#define KEY_L8 /* Paste 0x90 */ 144
#define KEY_L9 /* Find 0x91 */ 145
#define KEY_L10 /* Cut 0x92 */ 146
/*
* Fake 'scancodes' in the following ranges are generated for 2-byte
* codes not handled elsewhere. These correspond to most extended keys
* on so-called "Internet" keyboards:
*
* 0x79-0x93
* 0x96-0xa1
* 0xa3-0xac
* 0xb1-0xb4
* 0xba-0xbd
* 0xc2
* 0xcc-0xd2
* 0xd6-0xf7
*/
/*
* Remapped 'scancodes' are generated for single-byte codes in the range
* 0x59-0x5f,0x62-0x76. These are used for some extra keys on some keyboards.
*/
#define KEY_0x59 0x95
#define KEY_0x5A 0xA2
#define KEY_0x5B 0xAD
#define KEY_0x5C KEY_KP_EQUAL
#define KEY_0x5D 0xAE
#define KEY_0x5E 0xAF
#define KEY_0x5F 0xB0
#define KEY_0x62 0xB5
#define KEY_0x63 0xB6
#define KEY_0x64 0xB7
#define KEY_0x65 0xB8
#define KEY_0x66 0xB9
#define KEY_0x67 0xBE
#define KEY_0x68 0xBF
#define KEY_0x69 0xC0
#define KEY_0x6A 0xC1
#define KEY_0x6B 0xC3
#define KEY_0x6C 0xC4
#define KEY_0x6D 0xC5
#define KEY_0x6E 0xC6
#define KEY_0x6F 0xC7
#define KEY_0x70 0xC8
#define KEY_0x71 0xC9
#define KEY_0x72 0xCA
#define KEY_0x73 0xCB
#define KEY_0x74 0xD3
#define KEY_0x75 0xD4
#define KEY_0x76 0xD5
#define KEY_R_0xF4 0xF4
#define KEY_R_0xF5 0xF5
/* These are for "notused" and "unknown" entries in translation maps. */
#define KEY_NOTUSED 0
#define KEY_UNKNOWN 255
#endif /* _ATKEYNAMES_H */

View file

@ -0,0 +1,135 @@
/*
* Copyright (c) 2002-2003 by The XFree86 Project, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of the copyright holder(s)
* and author(s) shall not be used in advertising or otherwise to promote
* the sale, use or other dealings in this Software without prior written
* authorization from the copyright holder(s) and author(s).
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <xorg-server.h>
#include "xf86.h"
#include "xf86Xinput.h"
#include "xf86OSKbd.h"
#include "atKeynames.h"
Bool
ATScancode(InputInfoPtr pInfo, int *scanCode)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
switch (pKbd->scanPrefix) {
case 0:
switch (*scanCode) {
case KEY_Prefix0:
case KEY_Prefix1:
pKbd->scanPrefix = *scanCode; /* special prefixes */
return TRUE;
}
switch (*scanCode) {
case 0x59: *scanCode = KEY_0x59; break;
case 0x5a: *scanCode = KEY_0x5A; break;
case 0x5b: *scanCode = KEY_0x5B; break;
case 0x5c: *scanCode = KEY_KP_Equal; break; /* Keypad Equal */
case 0x5d: *scanCode = KEY_0x5D; break;
case 0x5e: *scanCode = KEY_0x5E; break;
case 0x5f: *scanCode = KEY_0x5F; break;
case 0x62: *scanCode = KEY_0x62; break;
case 0x63: *scanCode = KEY_0x63; break;
case 0x64: *scanCode = KEY_0x64; break;
case 0x65: *scanCode = KEY_0x65; break;
case 0x66: *scanCode = KEY_0x66; break;
case 0x67: *scanCode = KEY_0x67; break;
case 0x68: *scanCode = KEY_0x68; break;
case 0x69: *scanCode = KEY_0x69; break;
case 0x6a: *scanCode = KEY_0x6A; break;
case 0x6b: *scanCode = KEY_0x6B; break;
case 0x6c: *scanCode = KEY_0x6C; break;
case 0x6d: *scanCode = KEY_0x6D; break;
case 0x6e: *scanCode = KEY_0x6E; break;
case 0x6f: *scanCode = KEY_0x6F; break;
case 0x70: *scanCode = KEY_0x70; break;
case 0x71: *scanCode = KEY_0x71; break;
case 0x72: *scanCode = KEY_0x72; break;
case 0x73: *scanCode = KEY_0x73; break;
case 0x74: *scanCode = KEY_0x74; break;
case 0x75: *scanCode = KEY_0x75; break;
case 0x76: *scanCode = KEY_0x76; break;
}
break;
case KEY_Prefix0:
pKbd->scanPrefix = 0;
switch (*scanCode) {
case KEY_KP_7: *scanCode = KEY_Home; break; /* curs home */
case KEY_KP_8: *scanCode = KEY_Up; break; /* curs up */
case KEY_KP_9: *scanCode = KEY_PgUp; break; /* curs pgup */
case KEY_KP_4: *scanCode = KEY_Left; break; /* curs left */
case KEY_KP_5: *scanCode = KEY_Begin; break; /* curs begin */
case KEY_KP_6: *scanCode = KEY_Right; break; /* curs right */
case KEY_KP_1: *scanCode = KEY_End; break; /* curs end */
case KEY_KP_2: *scanCode = KEY_Down; break; /* curs down */
case KEY_KP_3: *scanCode = KEY_PgDown; break; /* curs pgdown */
case KEY_KP_0: *scanCode = KEY_Insert; break; /* curs insert */
case KEY_KP_Decimal: *scanCode = KEY_Delete; break; /* curs delete */
case KEY_Enter: *scanCode = KEY_KP_Enter; break; /* keypad enter */
case KEY_LCtrl: *scanCode = KEY_RCtrl; break; /* right ctrl */
case KEY_KP_Multiply: *scanCode = KEY_Print; break; /* print */
case KEY_Slash: *scanCode = KEY_KP_Divide; break; /* keyp divide */
case KEY_Alt: *scanCode = KEY_AltLang; break; /* right alt */
case KEY_ScrollLock: *scanCode = KEY_Break; break; /* curs break */
case 0x5b: *scanCode = KEY_LMeta; break;
case 0x5c: *scanCode = KEY_RMeta; break;
case 0x5d: *scanCode = KEY_Menu; break;
case KEY_F3: *scanCode = KEY_F13; break;
case KEY_F4: *scanCode = KEY_F14; break;
case KEY_F5: *scanCode = KEY_F15; break;
case KEY_F6: *scanCode = KEY_F16; break;
case KEY_F7: *scanCode = KEY_F17; break;
case KEY_KP_Plus: *scanCode = KEY_KP_DEC; break;
/* Remap codes 0x09 and 0x11 to avoid overlap with the
Henkan and Muhenkan keys on Japanese pc106 or pc103
keyboards */
case 0x01: *scanCode = KEY_R_0xF4; break;
case 0x03: *scanCode = KEY_R_0xF5; break;
case 0x2A:
case 0x36:
return TRUE;
default:
LogMessageVerbSigSafe(X_INFO, 4, "Unreported Prefix0 scancode: 0x%x\n",
*scanCode);
*scanCode += 0x78;
}
break;
case KEY_Prefix1:
pKbd->scanPrefix = (*scanCode == KEY_LCtrl) ? KEY_LCtrl : 0;
return TRUE;
case KEY_LCtrl:
pKbd->scanPrefix = 0;
if (*scanCode != KEY_NumLock)
return TRUE;
*scanCode = KEY_Pause; /* pause */
}
return FALSE;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,527 @@
/*
* Copyright (c) 2002 by The XFree86 Project, Inc.
* Author: Ivan Pascal.
*
* Based on the code from bsd_io.c which is
* Copyright 1992 by Rich Murphey <Rich@Rice.edu>
* Copyright 1993 by David Dawes <dawes@xfree86.org>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <xorg-server.h>
#include <X11/X.h>
#include <termios.h>
#include "compiler.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86_OSlib.h"
#include "xf86Xinput.h"
#include "xf86OSKbd.h"
#include "atKeynames.h"
#include "bsd_kbd.h"
extern int priv_open_device(const char *dev);
static KbdProtocolRec protocols[] = {
{"standard", PROT_STD },
#ifdef WSCONS_SUPPORT
{"wskbd", PROT_WSCONS },
#endif
{ NULL, PROT_UNKNOWN_KBD }
};
typedef struct {
struct termios kbdtty;
} BsdKbdPrivRec, *BsdKbdPrivPtr;
#ifdef WSCONS_SUPPORT
static Bool
WSSetVersion(int fd, const char *name)
{
#ifdef WSKBDIO_SETVERSION
int version = WSKBDIO_EVENT_VERSION;
if (ioctl(fd, WSKBDIO_SETVERSION, &version) == -1) {
xf86Msg(X_WARNING, "%s: cannot set version\n", name);
return FALSE;
}
#endif
return TRUE;
}
#endif
static
int KbdInit(InputInfoPtr pInfo, int what)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
BsdKbdPrivPtr priv = (BsdKbdPrivPtr) pKbd->private;
if (pKbd->isConsole) {
switch (pKbd->consType) {
#if defined(PCCONS_SUPPORT) || defined(SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) || defined (WSCONS_SUPPORT)
case PCCONS:
case SYSCONS:
case PCVT:
#if defined WSCONS_SUPPORT
case WSCONS:
#endif
tcgetattr(pInfo->fd, &(priv->kbdtty));
#endif
break;
}
}
return Success;
}
static void
SetKbdLeds(InputInfoPtr pInfo, int leds)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
int real_leds = 0;
#ifdef LED_CAP
if (leds & XLED1) real_leds |= LED_CAP;
#endif
#ifdef LED_NUM
if (leds & XLED2) real_leds |= LED_NUM;
#endif
#ifdef LED_SCR
if (leds & XLED3) real_leds |= LED_SCR;
if (leds & XLED4) real_leds |= LED_SCR;
#endif
switch (pKbd->consType) {
#ifdef PCCONS_SUPPORT
case PCCONS:
break;
#endif
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
case SYSCONS:
case PCVT:
ioctl(pInfo->fd, KDSETLED, real_leds);
break;
#endif
#if defined(WSCONS_SUPPORT)
case WSCONS:
ioctl(pInfo->fd, WSKBDIO_SETLEDS, &real_leds);
break;
#endif
}
}
static int
GetKbdLeds(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
int leds = 0, real_leds = 0;
switch (pKbd->consType) {
#ifdef PCCONS_SUPPORT
case PCCONS:
break;
#endif
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
case SYSCONS:
case PCVT:
ioctl(pInfo->fd, KDGETLED, &real_leds);
break;
#endif
#if defined(WSCONS_SUPPORT)
case WSCONS:
ioctl(pInfo->fd, WSKBDIO_GETLEDS, &real_leds);
break;
#endif
}
#ifdef LED_CAP
if (real_leds & LED_CAP) leds |= XLED1;
#endif
#ifdef LED_NUM
if (real_leds & LED_NUM) leds |= XLED2;
#endif
#ifdef LED_SCR
if (real_leds & LED_SCR) leds |= XLED3;
#endif
return(leds);
}
static int
KbdOn(InputInfoPtr pInfo, int what)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
BsdKbdPrivPtr priv = (BsdKbdPrivPtr) pKbd->private;
struct termios nTty;
#endif
#ifdef WSCONS_SUPPORT
int option;
#endif
if (pKbd->isConsole) {
switch (pKbd->consType) {
#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
case SYSCONS:
case PCCONS:
case PCVT:
#ifdef WSCONS_SUPPORT
case WSCONS:
#endif
nTty = priv->kbdtty;
nTty.c_iflag = IGNPAR | IGNBRK;
nTty.c_oflag = 0;
nTty.c_cflag = CREAD | CS8;
nTty.c_lflag = 0;
nTty.c_cc[VTIME] = 0;
nTty.c_cc[VMIN] = 1;
cfsetispeed(&nTty, 9600);
cfsetospeed(&nTty, 9600);
if (tcsetattr(pInfo->fd, TCSANOW, &nTty) < 0) {
xf86Msg(X_ERROR, "KbdOn: tcsetattr: %s\n",
strerror(errno));
}
break;
#endif
}
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) || defined (WSCONS_SUPPORT)
switch (pKbd->consType) {
case SYSCONS:
case PCVT:
#ifdef K_CODE
if (pKbd->CustomKeycodes)
ioctl(pInfo->fd, KDSKBMODE, K_CODE);
else
ioctl(pInfo->fd, KDSKBMODE, K_RAW);
#else
ioctl(pInfo->fd, KDSKBMODE, K_RAW);
#endif
break;
#ifdef WSCONS_SUPPORT
case WSCONS:
option = WSKBD_RAW;
if (ioctl(pInfo->fd, WSKBDIO_SETMODE, &option) == -1) {
FatalError("can't switch keyboard to raw mode. "
"Enable support for it in the kernel\n"
"or use for example:\n\n"
"Option \"Protocol\" \"wskbd\"\n"
"Option \"Device\" \"/dev/wskbd0\"\n"
"\nin your xorg.conf(5) file\n");
}
break;
#endif
}
#endif
} else {
switch (pKbd->consType) {
#ifdef WSCONS_SUPPORT
case WSCONS:
if ((pKbd->wsKbdDev[0] != 0) && (pInfo->fd == -1)) {
xf86Msg(X_INFO, "opening %s\n", pKbd->wsKbdDev);
pInfo->fd = open(pKbd->wsKbdDev, O_RDONLY | O_NONBLOCK | O_EXCL);
if (pInfo->fd == -1) {
xf86Msg(X_ERROR, "cannot open \"%s\"\n", pKbd->wsKbdDev);
return FALSE;
}
if (WSSetVersion(pInfo->fd, pInfo->name) == FALSE)
return FALSE;
}
break;
#endif
}
}
return Success;
}
static int
KbdOff(InputInfoPtr pInfo, int what)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
BsdKbdPrivPtr priv = (BsdKbdPrivPtr) pKbd->private;
#ifdef WSCONS_SUPPORT
int option;
#endif
if (pKbd->isConsole) {
switch (pKbd->consType) {
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
case SYSCONS:
case PCVT:
ioctl(pInfo->fd, KDSKBMODE, K_XLATE);
/* FALL THROUGH */
#endif
#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT)
case PCCONS:
tcsetattr(pInfo->fd, TCSANOW, &(priv->kbdtty));
break;
#endif
#ifdef WSCONS_SUPPORT
case WSCONS:
option = WSKBD_TRANSLATED;
ioctl(xf86Info.consoleFd, WSKBDIO_SETMODE, &option);
tcsetattr(pInfo->fd, TCSANOW, &(priv->kbdtty));
break;
#endif
}
} else {
switch (pKbd->consType) {
#ifdef WSCONS_SUPPORT
case WSCONS:
if ((pKbd->wsKbdDev[0] != 0) && (pInfo->fd != -1)) {
xf86Msg(X_INFO, "closing %s\n", pKbd->wsKbdDev);
/* need to close the fd while we're gone */
close(pInfo->fd);
pInfo->fd = -1;
}
break;
#endif
}
}
return Success;
}
static void
SoundBell(InputInfoPtr pInfo, int loudness, int pitch, int duration)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
#ifdef WSCONS_SUPPORT
struct wskbd_bell_data wsb;
#endif
if (loudness && pitch) {
switch (pKbd->consType) {
#ifdef PCCONS_SUPPORT
case PCCONS:
{ int data[2];
data[0] = pitch;
data[1] = (duration * loudness) / 50;
ioctl(pInfo->fd, CONSOLE_X_BELL, data);
break;
}
#endif
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
case SYSCONS:
case PCVT:
ioctl(pInfo->fd, KDMKTONE,
((1193190 / pitch) & 0xffff) |
(((unsigned long)duration*loudness/50)<<16));
break;
#endif
#if defined (WSCONS_SUPPORT)
case WSCONS:
wsb.which = WSKBD_BELL_DOALL;
wsb.pitch = pitch;
wsb.period = duration;
wsb.volume = loudness;
ioctl(pInfo->fd, WSKBDIO_COMPLEXBELL, &wsb);
break;
#endif
}
}
}
static void
stdReadInput(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
unsigned char rBuf[64];
int nBytes, i;
if ((nBytes = read( pInfo->fd, (char *)rBuf, sizeof(rBuf))) > 0) {
for (i = 0; i < nBytes; i++)
pKbd->PostEvent(pInfo, rBuf[i] & 0x7f,
rBuf[i] & 0x80 ? FALSE : TRUE);
}
}
#ifdef WSCONS_SUPPORT
static void
WSReadInput(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
struct wscons_event events[64];
int type;
int blocked, n, i;
if ((n = read( pInfo->fd, events, sizeof(events))) > 0) {
n /= sizeof(struct wscons_event);
for (i = 0; i < n; i++) {
type = events[i].type;
if (type == WSCONS_EVENT_KEY_UP || type == WSCONS_EVENT_KEY_DOWN) {
/* It seems better to block SIGIO there */
blocked = xf86BlockSIGIO();
pKbd->PostEvent(pInfo, (unsigned int)(events[i].value),
type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE);
xf86UnblockSIGIO(blocked);
}
} /* for */
}
}
static void
printWsType(const char *type, const char *name)
{
xf86Msg(X_PROBED, "%s: Keyboard type: %s\n", name, type);
}
#endif
static Bool
OpenKeyboard(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
int i;
KbdProtocolId prot = PROT_UNKNOWN_KBD;
char *s;
s = xf86SetStrOption(pInfo->options, "Protocol", NULL);
for (i = 0; protocols[i].name; i++) {
if (xf86NameCmp(s, protocols[i].name) == 0) {
prot = protocols[i].id;
break;
}
}
switch (prot) {
case PROT_STD:
pInfo->read_input = stdReadInput;
break;
#ifdef WSCONS_SUPPORT
case PROT_WSCONS:
pInfo->read_input = WSReadInput;
break;
#endif
default:
xf86Msg(X_ERROR,"\"%s\" is not a valid keyboard protocol name\n", s);
free(s);
return FALSE;
}
free(s);
if (prot == PROT_WSCONS)
s = xf86SetStrOption(pInfo->options, "Device", "/dev/wskbd");
else
s = xf86SetStrOption(pInfo->options, "Device", NULL);
if (s == NULL) {
pInfo->fd = xf86Info.consoleFd;
pKbd->isConsole = TRUE;
pKbd->consType = xf86Info.consType;
pKbd->wsKbdDev[0] = 0;
} else {
#ifndef X_PRIVSEP
pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
#else
pInfo->fd = priv_open_device(s);
#endif
if (pInfo->fd == -1) {
xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, s);
free(s);
return FALSE;
}
pKbd->isConsole = FALSE;
strncpy(pKbd->wsKbdDev, s, 256);
pKbd->consType = xf86Info.consType;
free(s);
}
#ifdef WSCONS_SUPPORT
if (prot == PROT_WSCONS) {
pKbd->consType = WSCONS;
if (WSSetVersion(pInfo->fd, pInfo->name) == FALSE)
return FALSE;
/* Find out keyboard type */
if (ioctl(pInfo->fd, WSKBDIO_GTYPE, &(pKbd->wsKbdType)) == -1) {
xf86Msg(X_ERROR, "%s: cannot get keyboard type", pInfo->name);
close(pInfo->fd);
return FALSE;
}
switch (pKbd->wsKbdType) {
case WSKBD_TYPE_PC_XT:
printWsType("XT", pInfo->name);
break;
case WSKBD_TYPE_PC_AT:
printWsType("AT", pInfo->name);
break;
case 0:
/* If wsKbdType==0, no keyboard attached to the mux. Assume USB. */
xf86Msg(X_WARNING, "%s: No keyboard attached, assuming USB\n",
pInfo->name);
pKbd->wsKbdType = WSKBD_TYPE_USB;
/* FALLTHROUGH */
case WSKBD_TYPE_USB:
printWsType("USB", pInfo->name);
break;
#ifdef WSKBD_TYPE_ADB
case WSKBD_TYPE_ADB:
printWsType("ADB", pInfo->name);
break;
#endif
#ifdef WSKBD_TYPE_LK201
case WSKBD_TYPE_LK201:
printWsType("LK201", pInfo->name);
break;
#endif
#ifdef WSKBD_TYPE_LK401
case WSKBD_TYPE_LK401:
printWsType("LK-401", pInfo->name);
break;
#endif
#ifdef WSKBD_TYPE_MAPLE
case WSKBD_TYPE_MAPLE:
printWsType("Maple", pInfo->name);
break;
#endif
#ifdef WSKBD_TYPE_SUN
case WSKBD_TYPE_SUN:
printWsType("Sun", pInfo->name);
break;
#endif
#ifdef WSKBD_TYPE_SUN5
case WSKBD_TYPE_SUN5:
printWsType("Sun5", pInfo->name);
break;
#endif
default:
xf86Msg(X_WARNING, "%s: Unsupported wskbd type \"%d\"\n",
pInfo->name, pKbd->wsKbdType);
printWsType("Unknown wskbd", pInfo->name);
break;
}
}
#endif
return TRUE;
}
_X_EXPORT Bool
xf86OSKbdPreInit(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = pInfo->private;
pKbd->KbdInit = KbdInit;
pKbd->KbdOn = KbdOn;
pKbd->KbdOff = KbdOff;
pKbd->Bell = SoundBell;
pKbd->SetLeds = SetKbdLeds;
pKbd->GetLeds = GetKbdLeds;
pKbd->KbdGetMapping = KbdGetMapping;
pKbd->RemapScanCode = NULL;
pKbd->OpenKeyboard = OpenKeyboard;
pKbd->private = calloc(sizeof(BsdKbdPrivRec), 1);
if (pKbd->private == NULL) {
xf86Msg(X_ERROR,"can't allocate keyboard OS private data\n");
return FALSE;
}
return TRUE;
}

View file

@ -0,0 +1,3 @@
extern void KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms,
CARD8 *pModMap);

View file

@ -0,0 +1,164 @@
/*
* Copyright 1997,1998 by UCHIYAMA Yasushi
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of UCHIYAMA Yasushi not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. UCHIYAMA Yasushi makes no representations
* about the suitability of this software for any purpose. It is provided
* "as is" without express or implied warranty.
*
* UCHIYAMA YASUSHI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL UCHIYAMA YASUSHI BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <xorg-server.h>
#include <X11/X.h>
#include "compiler.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86_OSlib.h"
#include "xf86Xinput.h"
#include "xf86OSKbd.h"
#include "atKeynames.h"
#include "xf86Keymap.h"
#include <stdio.h>
#include <errno.h>
#include <sys/time.h>
#include <sys/file.h>
#include <assert.h>
#include <mach.h>
#include <sys/ioctl.h>
typedef unsigned short kev_type; /* kd event type */
typedef unsigned char Scancode;
struct mouse_motion {
short mm_deltaX; /* units? */
short mm_deltaY;
};
typedef struct {
kev_type type; /* see below */
struct timeval time; /* timestamp */
union { /* value associated with event */
boolean_t up; /* MOUSE_LEFT .. MOUSE_RIGHT */
Scancode sc; /* KEYBD_EVENT */
struct mouse_motion mmotion; /* MOUSE_MOTION */
} value;
} kd_event;
/*
* kd_event ID's.
*/
#define MOUSE_LEFT 1 /* mouse left button up/down */
#define MOUSE_MIDDLE 2
#define MOUSE_RIGHT 3
#define MOUSE_MOTION 4 /* mouse motion */
#define KEYBD_EVENT 5 /* key up/down */
/***********************************************************************
* Keyboard
**********************************************************************/
static void
SoundKbdBell(InputInfoPtr pInfo, int loudness,int pitch,int duration)
{
return;
}
static void
SetKbdLeds(InputInfoPtr pInfo, int leds)
{
return;
}
static int
GetKbdLeds(InputInfoPtr pInfo)
{
return 0;
}
static void
KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
{
pKeySyms->map = map;
pKeySyms->mapWidth = GLYPHS_PER_KEY;
pKeySyms->minKeyCode = MIN_KEYCODE;
pKeySyms->maxKeyCode = MAX_KEYCODE;
return;
}
static int
KbdOn(InputInfoPtr pInfo, int what)
{
int data = 1;
if( ioctl( pInfo->fd, _IOW('k', 1, int),&data) < 0)
FatalError("Cannot set event mode on keyboard (%s)\n",strerror(errno));
return Success;
}
static int
KbdOff(InputInfoPtr pInfo, int what)
{
int data = 2;
if( ioctl( pInfo->fd, _IOW('k', 1, int),&data) < 0)
FatalError("can't reset keyboard mode (%s)\n",strerror(errno));
return Success;
}
static int
KbdInit(InputInfoPtr pInfo, int what)
{
return Success;
}
static void
ReadInput(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
kd_event ke;
while( read(pInfo->fd, &ke, sizeof(ke)) == sizeof(ke) )
pKbd->PostEvent(pInfo, ke.value.sc & 0x7f, ke.value.sc & 0x80 ? FALSE : TRUE);
}
static Bool
OpenKeyboard(InputInfoPtr pInfo)
{
pInfo->fd = xf86Info.consoleFd;
return TRUE;
}
Bool
xf86OSKbdPreInit(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = pInfo->private;
pKbd->KbdInit = KbdInit;
pKbd->KbdOn = KbdOn;
pKbd->KbdOff = KbdOff;
pKbd->Bell = SoundKbdBell;
pKbd->SetLeds = SetKbdLeds;
pKbd->GetLeds = GetKbdLeds;
pKbd->KbdGetMapping = KbdGetMapping;
pKbd->RemapScanCode = ATScancode;
pKbd->OpenKeyboard = OpenKeyboard;
pKbd->private = NULL;
pInfo->read_input = ReadInput;
return TRUE;
}

View file

@ -0,0 +1,435 @@
/*
* Copyright (c) 2002 by The XFree86 Project, Inc.
* Author: Ivan Pascal.
*
* Based on the code from
* xf86Config.c which is
* Copyright 1991-2002 by The XFree86 Project, Inc.
* Copyright 1997 by Metro Link, Inc.
* xf86Events.c and xf86Io.c which are
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <xorg-server.h>
#include <X11/X.h>
#include <X11/Xproto.h>
#include "xf86.h"
#include "atKeynames.h"
#include "xf86Privstr.h"
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h"
#include "inputstr.h"
#include "xf86Xinput.h"
#include "xf86_OSproc.h"
#include "xf86OSKbd.h"
#include "compiler.h"
#include "exevents.h"
#include <X11/Xatom.h>
#include "xserver-properties.h"
#include "xkbstr.h"
#include "xkbsrv.h"
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23
#define HAVE_THREADED_INPUT 1
#endif
#define CAPSFLAG 1
#define NUMFLAG 2
#define SCROLLFLAG 4
#define MODEFLAG 8
#define COMPOSEFLAG 16
/* Used to know when the first DEVICE_ON after a DEVICE_INIT is called */
#define INITFLAG (1U << 31)
static int KbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags);
static int KbdProc(DeviceIntPtr device, int what);
static void KbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl);
static void KbdBell(int percent, DeviceIntPtr dev, pointer ctrl, int unused);
static void PostKbdEvent(InputInfoPtr pInfo, unsigned int key, Bool down);
static void InitKBD(InputInfoPtr pInfo, Bool init);
static void UpdateLeds(InputInfoPtr pInfo);
static const char *kbdDefaults[] = {
#ifdef __NetBSD__
#ifdef DEFAULT_TO_WSKBD
"Protocol", "wskbd",
#else
"Protocol", "standard",
#endif
#else /* NetBSD */
"Protocol", "standard",
#endif /* NetBSD */
"XkbRules", XKB_DFLT_RULES,
"XkbModel", "pc105",
"XkbLayout", "us",
NULL
};
static char *xkb_rules;
static char *xkb_model;
static char *xkb_layout;
static char *xkb_variant;
static char *xkb_options;
_X_EXPORT InputDriverRec KBD = {
1,
"kbd",
NULL,
KbdPreInit,
NULL,
NULL
};
_X_EXPORT InputDriverRec KEYBOARD = {
1,
"keyboard",
NULL,
KbdPreInit,
NULL,
NULL
};
static XF86ModuleVersionInfo xf86KbdVersionRec = {
"kbd",
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
ABI_CLASS_XINPUT,
ABI_XINPUT_VERSION,
MOD_CLASS_XINPUT,
{0, 0, 0, 0}
};
static pointer
xf86KbdPlug(pointer module, pointer options, int *errmaj, int *errmin)
{
xf86AddInputDriver(&KBD, module, 0);
return module;
}
_X_EXPORT XF86ModuleData kbdModuleData = {
&xf86KbdVersionRec,
xf86KbdPlug,
NULL
};
static int
KbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
{
KbdDevPtr pKbd;
char *s;
const char **defaults;
int rc = Success;
/* Initialise the InputInfoRec. */
pInfo->type_name = XI_KEYBOARD;
pInfo->device_control = KbdProc;
/*
* We don't specify our own read_input function. We expect
* an OS specific readInput() function to handle this.
*/
pInfo->read_input = NULL;
pInfo->control_proc = NULL;
pInfo->switch_mode = NULL;
pInfo->fd = -1;
pInfo->dev = NULL;
defaults = kbdDefaults;
xf86CollectInputOptions(pInfo, defaults);
xf86ProcessCommonOptions(pInfo, pInfo->options);
if (!(pKbd = calloc(sizeof(KbdDevRec), 1))) {
rc = BadAlloc;
goto out;
}
pInfo->private = pKbd;
pKbd->PostEvent = PostKbdEvent;
if (!xf86OSKbdPreInit(pInfo)) {
rc = BadAlloc;
goto out;
}
if (!pKbd->OpenKeyboard(pInfo)) {
rc = BadMatch;
goto out;
}
if ((s = xf86SetStrOption(pInfo->options, "XLeds", NULL))) {
char *l, *end;
unsigned int i;
l = strtok(s, " \t\n");
while (l) {
i = strtoul(l, &end, 0);
if (*end == '\0')
pKbd->xledsMask |= 1L << (i - 1);
else {
xf86Msg(X_ERROR, "\"%s\" is not a valid XLeds value", l);
}
l = strtok(NULL, " \t\n");
}
free(s);
}
xkb_rules = xf86SetStrOption(pInfo->options, "XkbRules", NULL);
xkb_model = xf86SetStrOption(pInfo->options, "XkbModel", NULL);
xkb_layout = xf86SetStrOption(pInfo->options, "XkbLayout", NULL);
xkb_variant = xf86SetStrOption(pInfo->options, "XkbVariant", NULL);
xkb_options = xf86SetStrOption(pInfo->options, "XkbOptions", NULL);
pKbd->CustomKeycodes = xf86SetBoolOption(pInfo->options, "CustomKeycodes",
FALSE);
out:
return rc;
}
static void
KbdBell(int percent, DeviceIntPtr dev, pointer ctrl, int unused)
{
InputInfoPtr pInfo = (InputInfoPtr) dev->public.devicePrivate;
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
pKbd->Bell(pInfo, percent, ((KeybdCtrl*) ctrl)->bell_pitch,
((KeybdCtrl*) ctrl)->bell_duration);
}
static void
UpdateLeds(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
unsigned long leds = 0;
if (pKbd->keyLeds & CAPSFLAG) leds |= XLED1;
if (pKbd->keyLeds & NUMFLAG) leds |= XLED2;
if (pKbd->keyLeds & SCROLLFLAG ||
pKbd->keyLeds & MODEFLAG) leds |= XLED3;
if (pKbd->keyLeds & COMPOSEFLAG) leds |= XLED4;
pKbd->leds = (pKbd->leds & pKbd->xledsMask) | (leds & ~pKbd->xledsMask);
pKbd->SetLeds(pInfo, pKbd->leds);
}
static void
KbdCtrl( DeviceIntPtr device, KeybdCtrl *ctrl)
{
unsigned long leds;
InputInfoPtr pInfo = (InputInfoPtr) device->public.devicePrivate;
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
if ( ctrl->leds & XLED1) {
pKbd->keyLeds |= CAPSFLAG;
} else {
pKbd->keyLeds &= ~CAPSFLAG;
}
if ( ctrl->leds & XLED2) {
pKbd->keyLeds |= NUMFLAG;
} else {
pKbd->keyLeds &= ~NUMFLAG;
}
if ( ctrl->leds & XLED3) {
pKbd->keyLeds |= SCROLLFLAG;
} else {
pKbd->keyLeds &= ~SCROLLFLAG;
}
if ( ctrl->leds & (XCOMP|XLED4) ) {
pKbd->keyLeds |= COMPOSEFLAG;
} else {
pKbd->keyLeds &= ~COMPOSEFLAG;
}
leds = ctrl->leds & ~(XCAPS | XNUM | XSCR); /* ??? */
pKbd->leds = leds;
pKbd->SetLeds(pInfo, pKbd->leds);
}
static void
InitKBD(InputInfoPtr pInfo, Bool init)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
pKbd->scanPrefix = 0;
if (init) {
pKbd->keyLeds = pKbd->GetLeds(pInfo);
UpdateLeds(pInfo);
pKbd->keyLeds |= INITFLAG;
} else {
unsigned long leds = pKbd->keyLeds;
pKbd->keyLeds = pKbd->GetLeds(pInfo);
UpdateLeds(pInfo);
if ((pKbd->keyLeds & CAPSFLAG) !=
((leds & INITFLAG) ? 0 : (leds & CAPSFLAG))) {
pKbd->PostEvent(pInfo, KEY_CapsLock, TRUE);
pKbd->PostEvent(pInfo, KEY_CapsLock, FALSE);
}
if ((pKbd->keyLeds & NUMFLAG) !=
(leds & INITFLAG ? 0 : leds & NUMFLAG)) {
pKbd->PostEvent(pInfo, KEY_NumLock, TRUE);
pKbd->PostEvent(pInfo, KEY_NumLock, FALSE);
}
}
}
static int
KbdProc(DeviceIntPtr device, int what)
{
InputInfoPtr pInfo = device->public.devicePrivate;
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
XkbRMLVOSet rmlvo;
KeySymsRec keySyms;
CARD8 modMap[MAP_LENGTH];
int ret;
switch (what) {
case DEVICE_INIT:
ret = pKbd->KbdInit(pInfo, what);
if (ret != Success)
return ret;
pKbd->KbdGetMapping(pInfo, &keySyms, modMap);
device->public.on = FALSE;
rmlvo.rules = xkb_rules;
rmlvo.model = xkb_model;
rmlvo.layout = xkb_layout;
rmlvo.variant = xkb_variant;
rmlvo.options = xkb_options;
if (!InitKeyboardDeviceStruct(device, &rmlvo, KbdBell, KbdCtrl))
{
xf86Msg(X_ERROR, "%s: Keyboard initialization failed. This "
"could be a missing or incorrect setup of "
"xkeyboard-config.\n", device->name);
return BadValue;
}
# ifdef XI_PROP_DEVICE_NODE
{
const char *device_node =
xf86CheckStrOption(pInfo->options, "Device", NULL);
if (device_node)
{
Atom prop_device = MakeAtom(XI_PROP_DEVICE_NODE,
strlen(XI_PROP_DEVICE_NODE), TRUE);
XIChangeDeviceProperty(device, prop_device, XA_STRING, 8,
PropModeReplace, strlen(device_node),
device_node, FALSE);
}
}
# endif /* XI_PROP_DEVICE_NODE */
InitKBD(pInfo, TRUE);
break;
case DEVICE_ON:
if (device->public.on)
break;
/*
* Set the keyboard into "direct" mode and turn on
* event translation.
*/
if ((ret = pKbd->KbdOn(pInfo, what)) != Success)
return ret;
/*
* Discard any pending input after a VT switch to prevent the server
* passing on parts of the VT switch sequence.
*/
if (pInfo->fd >= 0) {
xf86FlushInput(pInfo->fd);
#if HAVE_THREADED_INPUT
xf86AddEnabledDevice(pInfo);
#else
AddEnabledDevice(pInfo->fd);
#endif
}
device->public.on = TRUE;
InitKBD(pInfo, FALSE);
break;
case DEVICE_CLOSE:
case DEVICE_OFF:
/*
* Restore original keyboard directness and translation.
*/
if (pInfo->fd != -1) {
#if HAVE_THREADED_INPUT
xf86RemoveEnabledDevice(pInfo);
#else
RemoveEnabledDevice(pInfo->fd);
#endif
}
pKbd->KbdOff(pInfo, what);
device->public.on = FALSE;
break;
default:
return BadValue;
}
return (Success);
}
static void
PostKbdEvent(InputInfoPtr pInfo, unsigned int scanCode, Bool down)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
DeviceIntPtr device = pInfo->dev;
KeyClassRec *keyc = device->key;
int state;
#ifdef DEBUG
LogMessageVerbSigSafe(X_INFO, -1, "kbd driver rec scancode: 0x%x %s\n", scanCode, down ? "down" : "up");
#endif
/*
* First do some special scancode remapping ...
*/
if (pKbd->RemapScanCode != NULL) {
if (pKbd->RemapScanCode(pInfo, (int*) &scanCode))
return;
} else {
if (pKbd->scancodeMap != NULL) {
TransMapPtr map = pKbd->scancodeMap;
if (scanCode >= map->begin && scanCode < map->end)
scanCode = map->map[scanCode - map->begin];
}
}
/*
* PC keyboards generate separate key codes for
* Alt+Print and Control+Pause but in the X keyboard model
* they need to get the same key code as the base key on the same
* physical keyboard key.
*/
state = XkbStateFieldFromRec(&keyc->xkbInfo->state);
if (((state & AltMask) == AltMask) && (scanCode == KEY_SysReqest))
scanCode = KEY_Print;
else if (scanCode == KEY_Break)
scanCode = KEY_Pause;
xf86PostKeyboardEvent(device, scanCode + MIN_KEYCODE, down);
}

View file

@ -0,0 +1,538 @@
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
* Copyright 1993 by David Dawes <dawes@XFree86.org>
* Copyright 1999 by David Holland <davidh@iquest.net)
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the names of Thomas Roell, David Dawes, and David Holland not be used
* in advertising or publicity pertaining to distribution of the software
* without specific, written prior permission. Thomas Roell, David Dawes, and
* David Holland make no representations about the suitability of this software
* for any purpose. It is provided "as is" without express or implied
* warranty.
*
* THOMAS ROELL, DAVID DAWES, AND DAVID HOLLAND DISCLAIM ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL THOMAS ROELL, DAVID DAWES, OR DAVID HOLLAND
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Copyright (c) 2004-2009, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <xorg-server.h>
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86_OSlib.h"
#include "xf86OSKbd.h"
#include "sun_kbd.h"
#include <sys/stropts.h>
#include <sys/vuid_event.h>
#include <sys/kbd.h>
#include <sys/note.h> /* needed before including older versions of hid.h */
#include <sys/usb/clients/hid/hid.h>
static int KbdOn(InputInfoPtr pInfo, int what);
static Bool OpenKeyboard(InputInfoPtr pInfo);
static void CloseKeyboard(InputInfoPtr pInfo);
static void
sunKbdSetLeds(InputInfoPtr pInfo, int leds)
{
int i;
uchar_t setleds = (uchar_t) (leds & 0xFF);
SYSCALL(i = ioctl(pInfo->fd, KIOCSLED, &setleds));
if (i < 0) {
xf86Msg(X_ERROR, "%s: Failed to set keyboard LED's: %s\n",
pInfo->name, strerror(errno));
}
}
static int
sunKbdGetLeds(InputInfoPtr pInfo)
{
int i;
uchar_t leds = 0;
SYSCALL(i = ioctl(pInfo->fd, KIOCGLED, &leds));
if (i < 0) {
xf86Msg(X_ERROR, "%s: Failed to get keyboard LED's: %s\n",
pInfo->name, strerror(errno));
}
return (int) leds;
}
/*
* Save initial keyboard state. This is called at the start of each server
* generation.
*/
static int
KbdInit(InputInfoPtr pInfo, int what)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
sunKbdPrivPtr priv = (sunKbdPrivPtr) pKbd->private;
pointer options = pInfo->options;
int ktype, klayout, i;
const char *ktype_name;
priv->kbdActive = FALSE;
priv->otranslation = -1;
priv->odirect = -1;
if (options != NULL) {
priv->strmod = xf86SetStrOption(options, "StreamsModule", NULL);
} else {
priv->strmod = NULL;
}
i = KbdOn(pInfo, DEVICE_INIT);
if (i != Success) {
return i;
}
SYSCALL(i = ioctl(pInfo->fd, KIOCTYPE, &ktype));
if (i < 0) {
xf86Msg(X_ERROR, "%s: Unable to determine keyboard type: %s\n",
pInfo->name, strerror(errno));
return BadImplementation;
}
SYSCALL(i = ioctl(pInfo->fd, KIOCLAYOUT, &klayout));
if (i < 0) {
xf86Msg(X_ERROR, "%s: Unable to determine keyboard layout: %s\n",
pInfo->name, strerror(errno));
return BadImplementation;
}
switch (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, "%s: Keyboard type: %s (%d)\n",
pInfo->name, ktype_name, ktype);
xf86Msg(X_PROBED, "%s: Keyboard layout: %d\n", pInfo->name, klayout);
priv->ktype = ktype;
return Success;
}
static int
KbdOn(InputInfoPtr pInfo, int what)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
sunKbdPrivPtr priv = (sunKbdPrivPtr) pKbd->private;
int ktrans, kdirect, i;
int io_get_direct = KIOCGDIRECT;
int io_set_direct = KIOCSDIRECT;
if (priv->kbdActive) {
return Success;
}
if (pInfo->fd == -1) {
if (!OpenKeyboard(pInfo)) {
return BadImplementation;
}
}
if (priv->strmod) {
/* Check to see if module is already pushed */
SYSCALL(i = ioctl(pInfo->fd, I_FIND, priv->strmod));
if (i == 0) { /* Not already pushed */
SYSCALL(i = ioctl(pInfo->fd, I_PUSH, priv->strmod));
if (i < 0) {
xf86Msg(X_ERROR, "%s: cannot push module '%s' onto "
"keyboard device: %s\n",
pInfo->name, priv->strmod, strerror(errno));
}
}
#ifdef HIDIOCKMSDIRECT
if (strcmp(priv->strmod, "usbkbm") == 0) {
io_get_direct = HIDIOCKMGDIRECT;
io_set_direct = HIDIOCKMSDIRECT;
}
#endif
}
SYSCALL(i = ioctl(pInfo->fd, io_get_direct, &kdirect));
if (i < 0) {
xf86Msg(X_ERROR,
"%s: Unable to determine keyboard direct setting: %s\n",
pInfo->name, strerror(errno));
return BadImplementation;
}
priv->odirect = kdirect;
kdirect = 1;
SYSCALL(i = ioctl(pInfo->fd, io_set_direct, &kdirect));
if (i < 0) {
xf86Msg(X_ERROR, "%s: Failed turning keyboard direct mode on: %s\n",
pInfo->name, strerror(errno));
return BadImplementation;
}
/* Setup translation */
SYSCALL(i = ioctl(pInfo->fd, KIOCGTRANS, &ktrans));
if (i < 0) {
xf86Msg(X_ERROR,
"%s: Unable to determine keyboard translation mode: %s\n",
pInfo->name, strerror(errno));
return BadImplementation;
}
priv->otranslation = ktrans;
ktrans = TR_UNTRANS_EVENT;
SYSCALL(i = ioctl(pInfo->fd, KIOCTRANS, &ktrans));
if (i < 0) {
xf86Msg(X_ERROR, "%s: Failed setting keyboard translation mode: %s\n",
pInfo->name, strerror(errno));
return BadImplementation;
}
priv->oleds = sunKbdGetLeds(pInfo);
/* Allocate here so we don't alloc in ReadInput which may be called
from SIGIO handler. */
priv->remove_timer = TimerSet(priv->remove_timer, 0, 0, NULL, NULL);
priv->kbdActive = TRUE;
return Success;
}
static int
KbdOff(InputInfoPtr pInfo, int what)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
sunKbdPrivPtr priv = (sunKbdPrivPtr) pKbd->private;
int i;
int io_set_direct, kdirect;
if (priv->remove_timer) {
TimerFree(priv->remove_timer);
priv->remove_timer = NULL;
}
if (!priv->kbdActive) {
return Success;
}
if (pInfo->fd == -1) {
priv->kbdActive = FALSE;
return Success;
}
/* restore original state */
if (priv->oleds != -1) {
sunKbdSetLeds(pInfo, priv->oleds);
priv->oleds = -1;
}
if (priv->otranslation != -1) {
SYSCALL(i = ioctl(pInfo->fd, KIOCTRANS, &priv->otranslation));
if (i < 0) {
xf86Msg(X_ERROR,
"%s: Unable to restore keyboard translation mode: %s\n",
pInfo->name, strerror(errno));
return BadImplementation;
}
priv->otranslation = -1;
}
io_set_direct = KIOCSDIRECT;
kdirect = priv->odirect;
#ifdef HIDIOCKMSDIRECT
if ((priv->strmod != NULL) && (strcmp(priv->strmod, "usbkbm") == 0)) {
io_set_direct = HIDIOCKMSDIRECT;
kdirect = 0;
}
#endif
if (kdirect != -1) {
SYSCALL(i = ioctl(pInfo->fd, io_set_direct, &kdirect));
if (i < 0) {
xf86Msg(X_ERROR,
"%s: Unable to restore keyboard direct setting: %s\n",
pInfo->name, strerror(errno));
return BadImplementation;
}
priv->odirect = -1;
}
if (priv->strmod) {
SYSCALL(i = ioctl(pInfo->fd, I_POP, priv->strmod));
if (i < 0) {
xf86Msg(X_WARNING,
"%s: cannot pop module '%s' off keyboard device: %s\n",
pInfo->name, priv->strmod, strerror(errno));
}
}
CloseKeyboard(pInfo);
return Success;
}
static void
SoundKbdBell(InputInfoPtr pInfo, int loudness, int pitch, int duration)
{
int kbdCmd, i;
#ifdef KIOCMKTONE
int cycles;
int mktonevalue;
#endif
if (loudness && pitch)
{
#ifdef KIOCMKTONE
if (pitch == 0)
cycles = UINT16_MAX;
else if (pitch >= UINT16_MAX)
cycles = 0;
else {
cycles = (PIT_HZ + pitch / 2) / pitch;
if (cycles > UINT16_MAX)
cycles = UINT16_MAX;
}
mktonevalue = cycles | (((duration * loudness * 20) / 1000) << 16);
errno = 0;
SYSCALL(i = ioctl (pInfo->fd, KIOCMKTONE, mktonevalue));
if (i == 0)
return;
if (errno != EINVAL) {
if (errno != EAGAIN)
xf86Msg(X_ERROR, "%s: Failed to activate bell: %s\n",
pInfo->name, strerror(errno));
return;
}
#endif
kbdCmd = KBD_CMD_BELL;
SYSCALL(i = ioctl (pInfo->fd, KIOCCMD, &kbdCmd));
if (i < 0) {
xf86Msg(X_ERROR, "%s: Failed to activate bell: %s\n",
pInfo->name, strerror(errno));
}
usleep(duration * loudness * 20);
kbdCmd = KBD_CMD_NOBELL;
SYSCALL(i = ioctl (pInfo->fd, KIOCCMD, &kbdCmd));
if (i < 0) {
xf86Msg(X_ERROR, "%s: Failed to deactivate bell: %s\n",
pInfo->name, strerror(errno));
}
}
}
static void
SetKbdLeds(InputInfoPtr pInfo, int leds)
{
int real_leds = sunKbdGetLeds(pInfo);
real_leds &= ~(LED_CAPS_LOCK | LED_NUM_LOCK | LED_SCROLL_LOCK | LED_COMPOSE);
if (leds & XLED1) real_leds |= LED_CAPS_LOCK;
if (leds & XLED2) real_leds |= LED_NUM_LOCK;
if (leds & XLED3) real_leds |= LED_SCROLL_LOCK;
if (leds & XLED4) real_leds |= LED_COMPOSE;
sunKbdSetLeds(pInfo, real_leds);
}
static int
GetKbdLeds(InputInfoPtr pInfo)
{
int leds = 0;
int real_leds = sunKbdGetLeds(pInfo);
if (real_leds & LED_CAPS_LOCK) leds |= XLED1;
if (real_leds & LED_NUM_LOCK) leds |= XLED2;
if (real_leds & LED_SCROLL_LOCK) leds |= XLED3;
if (real_leds & LED_COMPOSE) leds |= XLED4;
return leds;
}
static void
CloseKeyboard(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
sunKbdPrivPtr priv = (sunKbdPrivPtr) pKbd->private;
close(pInfo->fd);
pInfo->fd = -1;
priv->kbdActive = FALSE;
}
/* Called from OsTimer callback, since removing a device from the device
list or changing pInfo->fd while xf86Wakeup is looping through the list
causes server crashes */
static CARD32
RemoveKeyboard(OsTimerPtr timer, CARD32 time, pointer arg)
{
InputInfoPtr pInfo = (InputInfoPtr) arg;
CloseKeyboard(pInfo);
xf86DisableDevice(pInfo->dev, TRUE);
return 0; /* All done, don't set to run again */
}
static void
ReadInput(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
sunKbdPrivPtr priv = (sunKbdPrivPtr) pKbd->private;
Firm_event event[64];
int nBytes, i;
while (TRUE) {
/* I certainly hope it's not possible to read partial events */
nBytes = read(pInfo->fd, (char *)event, sizeof(event));
if (nBytes > 0) {
for (i = 0; i < (nBytes / sizeof(Firm_event)); i++) {
pKbd->PostEvent(pInfo, event[i].id & 0xFF,
event[i].value == VKEY_DOWN ? TRUE : FALSE);
}
} else if (nBytes == -1) {
switch (errno) {
case EAGAIN: /* Nothing to read now */
return;
case EINTR: /* Interrupted, try again */
break;
case ENODEV: /* May happen when USB kbd is unplugged */
/* We use X_NONE here because it didn't alloc since we
may be called from SIGIO handler. No longer true for
sigsafe logging, but matters for older servers */
LogMessageVerbSigSafe(X_NONE, 0,
"%s: Device no longer present - removing.\n",
pInfo->name);
xf86RemoveEnabledDevice(pInfo);
priv->remove_timer = TimerSet(priv->remove_timer, 0, 1,
RemoveKeyboard, pInfo);
return;
default: /* All other errors */
/* We use X_NONE here because it didn't alloc since we
may be called from SIGIO handler. No longer true for
sigsafe logging, but matters for older servers */
LogMessageVerbSigSafe(X_NONE, 0, "%s: Read error: %s\n", pInfo->name,
strerror(errno));
return;
}
} else { /* nBytes == 0, so nothing more to read */
return;
}
}
}
static Bool
OpenKeyboard(InputInfoPtr pInfo)
{
char *kbdPath = xf86SetStrOption(pInfo->options, "Device", "/dev/kbd");
Bool ret;
pInfo->fd = open(kbdPath, O_RDONLY | O_NONBLOCK);
if (pInfo->fd == -1) {
xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, kbdPath);
ret = FALSE;
} else {
xf86MsgVerb(X_INFO, 3, "%s: Opened device \"%s\"\n", pInfo->name,
kbdPath);
pInfo->read_input = ReadInput;
ret = TRUE;
/* in case it wasn't set and we fell back to default */
xf86ReplaceStrOption(pInfo->options, "Device", kbdPath);
}
free(kbdPath);
return ret;
}
_X_EXPORT Bool
xf86OSKbdPreInit(InputInfoPtr pInfo)
{
KbdDevPtr pKbd = pInfo->private;
pKbd->KbdInit = KbdInit;
pKbd->KbdOn = KbdOn;
pKbd->KbdOff = KbdOff;
pKbd->Bell = SoundKbdBell;
pKbd->SetLeds = SetKbdLeds;
pKbd->GetLeds = GetKbdLeds;
pKbd->KbdGetMapping = KbdGetMapping;
pKbd->RemapScanCode = NULL;
pKbd->OpenKeyboard = OpenKeyboard;
pKbd->private = calloc(sizeof(sunKbdPrivRec), 1);
if (pKbd->private == NULL) {
xf86Msg(X_ERROR,"can't allocate keyboard OS private data\n");
return FALSE;
} else {
sunKbdPrivPtr priv = (sunKbdPrivPtr) pKbd->private;
priv->otranslation = -1;
priv->odirect = -1;
}
return TRUE;
}

View file

@ -0,0 +1,40 @@
/*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef _XORG_SUN_KBD_H_
#define _XORG_SUN_KBD_H_
typedef struct {
int ktype; /* Keyboard type from KIOCTYPE */
Bool kbdActive; /* Have we set kbd modes for X? */
int otranslation; /* Original translation mode */
int odirect; /* Original "direct" mode setting */
int oleds; /* Original LED state */
const char * strmod; /* Streams module pushed on kbd device */
OsTimerPtr remove_timer; /* Callback for removal on ENODEV */
} sunKbdPrivRec, *sunKbdPrivPtr;
/* sun_kbdMap.c */
extern void KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms,
CARD8 *pModMap);
#endif

View file

@ -0,0 +1,683 @@
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
* Copyright 1993 by David Dawes <dawes@xfree86.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the names of Thomas Roell and David Dawes not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Thomas Roell and David Dawes make no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* THOMAS ROELL AND DAVID DAWES DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
* IN NO EVENT SHALL THOMAS ROELL OR DAVID DAWES BE LIABLE FOR ANY SPECIAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <xorg-server.h>
#include <X11/Xfuncproto.h>
#include <X11/Sunkeysym.h>
#include "atKeynames.h"
#include "xf86OSKbd.h"
#include "xf86Keymap.h"
#include "sun_kbd.h"
#include <sys/kbd.h>
/* Map the Solaris keycodes to the "XFree86" keycodes. */
/*
* Additional Korean 106 Keyboard Keys not defined in atKeynames.h
* These are exactly same USB usage id with Kana(0x90) and Eisu(0x91) keys
* in Mac Japanese keyboard. From /usr/X11/lib/X11/xkb/keycodes/xfree86, these
* are 209 and 210. So these should be 0xc9(209-8=201) and 0xca(210-8=202).
* <EISU> = 210; // Alphanumeric mode on macintosh
* <KANA> = 209; // Kana mode on macintosh
*/
#define KEY_Hangul 0xC9 /* Also Kana in Mac Japanaese kbd */
#define KEY_Hangul_Hanja 0xCA /* Also Eisu in Mac Japanaese kbd */
/* Override atKeynames.h values with unique keycodes, so we can distinguish
KEY_F15 from KEY_HKTG & KEY_KP_DEC from KEY_BSlash2 */
#undef KEY_HKTG
#define KEY_HKTG /* Hirugana/Katakana tog 0xC8 */ 200 /* was 112 */
#undef KEY_BSlash2
#define KEY_BSlash2 /* \ _ 0xCB */ 203 /* was 115 */
static unsigned char sunmap[256] = {
#if defined(i386) || defined(__i386) || defined(__i386__) || defined(__x86)
KEY_NOTUSED, /* 0 */
KEY_Tilde, /* 1 */
KEY_1, /* 2 */
KEY_2, /* 3 */
KEY_3, /* 4 */
KEY_4, /* 5 */
KEY_5, /* 6 */
KEY_6, /* 7 */
KEY_7, /* 8 */
KEY_8, /* 9 */
KEY_9, /* 10 */
KEY_0, /* 11 */
KEY_Minus, /* 12 */
KEY_Equal, /* 13 */
0x7D, /*KEY_P_YEN*/ /* 14 */
KEY_BackSpace, /* 15 */
KEY_Tab, /* 16 */
KEY_Q, /* 17 */
KEY_W, /* 18 */
KEY_E, /* 19 */
KEY_R, /* 20 */
KEY_T, /* 21 */
KEY_Y, /* 22 */
KEY_U, /* 23 */
KEY_I, /* 24 */
KEY_O, /* 25 */
KEY_P, /* 26 */
KEY_LBrace, /* 27 */
KEY_RBrace, /* 28 */
KEY_BSlash, /* 29 */
KEY_CapsLock, /* 30 */
KEY_A, /* 31 */
KEY_S, /* 32 */
KEY_D, /* 33 */
KEY_F, /* 34 */
KEY_G, /* 35 */
KEY_H, /* 36 */
KEY_J, /* 37 */
KEY_K, /* 38 */
KEY_L, /* 39 */
KEY_SemiColon, /* 40 */
KEY_Quote, /* 41 */
KEY_UNKNOWN, /* 42 */
KEY_Enter, /* 43 */
KEY_ShiftL, /* 44 */
KEY_Less, /* 45 */
KEY_Z, /* 46 */
KEY_X, /* 47 */
KEY_C, /* 48 */
KEY_V, /* 49 */
KEY_B, /* 50 */
KEY_N, /* 51 */
KEY_M, /* 52 */
KEY_Comma, /* 53 */
KEY_Period, /* 54 */
KEY_Slash, /* 55 */
KEY_BSlash2, /* 56 */
KEY_ShiftR, /* 57 */
KEY_LCtrl, /* 58 */
KEY_LMeta, /* 59 */
KEY_Alt, /* 60 */
KEY_Space, /* 61 */
KEY_AltLang, /* 62 */
KEY_RMeta, /* 63 */
KEY_RCtrl, /* 64 */
KEY_Menu, /* 65 */
KEY_UNKNOWN, /* 66 */
KEY_UNKNOWN, /* 67 */
KEY_UNKNOWN, /* 68 */
KEY_UNKNOWN, /* 69 */
KEY_UNKNOWN, /* 70 */
KEY_UNKNOWN, /* 71 */
KEY_UNKNOWN, /* 72 */
KEY_UNKNOWN, /* 73 */
KEY_UNKNOWN, /* 74 */
KEY_Insert, /* 75 */
KEY_Delete, /* 76 */
KEY_UNKNOWN, /* 77 */
KEY_UNKNOWN, /* 78 */
KEY_Left, /* 79 */
KEY_Home, /* 80 */
KEY_End, /* 81 */
KEY_UNKNOWN, /* 82 */
KEY_Up, /* 83 */
KEY_Down, /* 84 */
KEY_PgUp, /* 85 */
KEY_PgDown, /* 86 */
KEY_UNKNOWN, /* 87 */
KEY_UNKNOWN, /* 88 */
KEY_Right, /* 89 */
KEY_NumLock, /* 90 */
KEY_KP_7, /* 91 */
KEY_KP_4, /* 92 */
KEY_KP_1, /* 93 */
KEY_UNKNOWN, /* 94 */
KEY_KP_Divide, /* 95 */
KEY_KP_8, /* 96 */
KEY_KP_5, /* 97 */
KEY_KP_2, /* 98 */
KEY_KP_0, /* 99 */
KEY_KP_Multiply, /* 100 */
KEY_KP_9, /* 101 */
KEY_KP_6, /* 102 */
KEY_KP_3, /* 103 */
KEY_KP_Decimal, /* 104 */
KEY_KP_Minus, /* 105 */
KEY_KP_Plus, /* 106 */
KEY_UNKNOWN, /* 107 */
KEY_KP_Enter, /* 108 */
KEY_UNKNOWN, /* 109 */
KEY_Escape, /* 110 */
KEY_UNKNOWN, /* 111 */
KEY_F1, /* 112 */
KEY_F2, /* 113 */
KEY_F3, /* 114 */
KEY_F4, /* 115 */
KEY_F5, /* 116 */
KEY_F6, /* 117 */
KEY_F7, /* 118 */
KEY_F8, /* 119 */
KEY_F9, /* 120 */
KEY_F10, /* 121 */
KEY_F11, /* 122 */
KEY_F12, /* 123 */
KEY_Print, /* 124 */
KEY_ScrollLock, /* 125 */
KEY_Pause, /* 126 */
KEY_UNKNOWN, /* 127 */
KEY_UNKNOWN, /* 128 */
KEY_UNKNOWN, /* 129 */
KEY_UNKNOWN, /* 130 */
KEY_NFER, /* 131 */
KEY_XFER, /* 132 */
KEY_HKTG, /* 133 */
KEY_UNKNOWN, /* 134 */
#elif defined(sparc) || defined(__sparc__)
KEY_UNKNOWN, /* 0x00 */
KEY_UNKNOWN, /* 0x01 */
KEY_UNKNOWN, /* 0x02 */
KEY_UNKNOWN, /* 0x03 */
KEY_UNKNOWN, /* 0x04 */
KEY_F1, /* 0x05 */
KEY_F2, /* 0x06 */
KEY_F10, /* 0x07 */
KEY_F3, /* 0x08 */
KEY_F11, /* 0x09 */
KEY_F4, /* 0x0A */
KEY_F12, /* 0x0B */
KEY_F5, /* 0x0C */
KEY_UNKNOWN, /* 0x0D */
KEY_F6, /* 0x0E */
KEY_UNKNOWN, /* 0x0F */
KEY_F7, /* 0x10 */
KEY_F8, /* 0x11 */
KEY_F9, /* 0x12 */
KEY_Alt, /* 0x13 */
KEY_Up, /* 0x14 */
KEY_Pause, /* 0x15 */
KEY_SysReqest, /* 0x16 */
KEY_ScrollLock, /* 0x17 */
KEY_Left, /* 0x18 */
KEY_UNKNOWN, /* 0x19 */
KEY_UNKNOWN, /* 0x1A */
KEY_Down, /* 0x1B */
KEY_Right, /* 0x1C */
KEY_Escape, /* 0x1D */
KEY_1, /* 0x1E */
KEY_2, /* 0x1F */
KEY_3, /* 0x20 */
KEY_4, /* 0x21 */
KEY_5, /* 0x22 */
KEY_6, /* 0x23 */
KEY_7, /* 0x24 */
KEY_8, /* 0x25 */
KEY_9, /* 0x26 */
KEY_0, /* 0x27 */
KEY_Minus, /* 0x28 */
KEY_Equal, /* 0x29 */
KEY_Tilde, /* 0x2A */
KEY_BackSpace, /* 0x2B */
KEY_Insert, /* 0x2C */
KEY_UNKNOWN, /* 0x2D */
KEY_KP_Divide, /* 0x2E */
KEY_KP_Multiply, /* 0x2F */
KEY_UNKNOWN, /* 0x30 */
KEY_UNKNOWN, /* 0x31 */
KEY_KP_Decimal, /* 0x32 */
KEY_UNKNOWN, /* 0x33 */
KEY_Home, /* 0x34 */
KEY_Tab, /* 0x35 */
KEY_Q, /* 0x36 */
KEY_W, /* 0x37 */
KEY_E, /* 0x38 */
KEY_R, /* 0x39 */
KEY_T, /* 0x3A */
KEY_Y, /* 0x3B */
KEY_U, /* 0x3C */
KEY_I, /* 0x3D */
KEY_O, /* 0x3E */
KEY_P, /* 0x3F */
KEY_LBrace, /* 0x40 */
KEY_RBrace, /* 0x41 */
KEY_Delete, /* 0x42 */
KEY_UNKNOWN, /* 0x43 */
KEY_KP_7, /* 0x44 */
KEY_KP_8, /* 0x45 */
KEY_KP_9, /* 0x46 */
KEY_KP_Minus, /* 0x47 */
KEY_UNKNOWN, /* 0x48 */
KEY_UNKNOWN, /* 0x49 */
KEY_End, /* 0x4A */
KEY_UNKNOWN, /* 0x4B */
KEY_LCtrl, /* 0x4C */
KEY_A, /* 0x4D */
KEY_S, /* 0x4E */
KEY_D, /* 0x4F */
KEY_F, /* 0x50 */
KEY_G, /* 0x51 */
KEY_H, /* 0x52 */
KEY_J, /* 0x53 */
KEY_K, /* 0x54 */
KEY_L, /* 0x55 */
KEY_SemiColon, /* 0x56 */
KEY_Quote, /* 0x57 */
KEY_BSlash, /* 0x58 */
KEY_Enter, /* 0x59 */
KEY_KP_Enter, /* 0x5A */
KEY_KP_4, /* 0x5B */
KEY_KP_5, /* 0x5C */
KEY_KP_6, /* 0x5D */
KEY_KP_0, /* 0x5E */
KEY_UNKNOWN, /* 0x5F */
KEY_PgUp, /* 0x60 */
KEY_UNKNOWN, /* 0x61 */
KEY_NumLock, /* 0x62 */
KEY_ShiftL, /* 0x63 */
KEY_Z, /* 0x64 */
KEY_X, /* 0x65 */
KEY_C, /* 0x66 */
KEY_V, /* 0x67 */
KEY_B, /* 0x68 */
KEY_N, /* 0x69 */
KEY_M, /* 0x6A */
KEY_Comma, /* 0x6B */
KEY_Period, /* 0x6C */
KEY_Slash, /* 0x6D */
KEY_ShiftR, /* 0x6E */
KEY_UNKNOWN, /* 0x6F */
KEY_KP_1, /* 0x70 */
KEY_KP_2, /* 0x71 */
KEY_KP_3, /* 0x72 */
KEY_UNKNOWN, /* 0x73 */
KEY_UNKNOWN, /* 0x74 */
KEY_UNKNOWN, /* 0x75 */
KEY_UNKNOWN, /* 0x76 */
KEY_CapsLock, /* 0x77 */
KEY_LMeta, /* 0x78 */
KEY_Space, /* 0x79 */
KEY_RMeta, /* 0x7A */
KEY_PgDown, /* 0x7B */
KEY_UNKNOWN, /* 0x7C */
KEY_KP_Plus, /* 0x7D */
KEY_UNKNOWN, /* 0x7E */
KEY_UNKNOWN, /* 0x7F */
#endif
/* The rest default to KEY_UNKNOWN */
};
static
TransMapRec sunTransMap = {
0,
(sizeof(sunmap)/sizeof(unsigned char)),
sunmap
};
#if defined(KB_USB)
static unsigned char usbmap[256] = {
/*
* partially taken from ../bsd/bsd_KbdMap.c
*
* added keycodes for Sun special keys (left function keys, audio control)
*/
/* 0 */ KEY_NOTUSED,
/* 1 */ KEY_NOTUSED,
/* 2 */ KEY_NOTUSED,
/* 3 */ KEY_NOTUSED,
/* 4 */ KEY_A,
/* 5 */ KEY_B,
/* 6 */ KEY_C,
/* 7 */ KEY_D,
/* 8 */ KEY_E,
/* 9 */ KEY_F,
/* 10 */ KEY_G,
/* 11 */ KEY_H,
/* 12 */ KEY_I,
/* 13 */ KEY_J,
/* 14 */ KEY_K,
/* 15 */ KEY_L,
/* 16 */ KEY_M,
/* 17 */ KEY_N,
/* 18 */ KEY_O,
/* 19 */ KEY_P,
/* 20 */ KEY_Q,
/* 21 */ KEY_R,
/* 22 */ KEY_S,
/* 23 */ KEY_T,
/* 24 */ KEY_U,
/* 25 */ KEY_V,
/* 26 */ KEY_W,
/* 27 */ KEY_X,
/* 28 */ KEY_Y,
/* 29 */ KEY_Z,
/* 30 */ KEY_1, /* 1 !*/
/* 31 */ KEY_2, /* 2 @ */
/* 32 */ KEY_3, /* 3 # */
/* 33 */ KEY_4, /* 4 $ */
/* 34 */ KEY_5, /* 5 % */
/* 35 */ KEY_6, /* 6 ^ */
/* 36 */ KEY_7, /* 7 & */
/* 37 */ KEY_8, /* 8 * */
/* 38 */ KEY_9, /* 9 ( */
/* 39 */ KEY_0, /* 0 ) */
/* 40 */ KEY_Enter, /* Return */
/* 41 */ KEY_Escape, /* Escape */
/* 42 */ KEY_BackSpace, /* Backspace Delete */
/* 43 */ KEY_Tab, /* Tab */
/* 44 */ KEY_Space, /* Space */
/* 45 */ KEY_Minus, /* - _ */
/* 46 */ KEY_Equal, /* = + */
/* 47 */ KEY_LBrace, /* [ { */
/* 48 */ KEY_RBrace, /* ] } */
/* 49 */ KEY_BSlash, /* \ | */
/* 50 */ KEY_BSlash, /* \ _ # ~ on some keyboards */
/* 51 */ KEY_SemiColon, /* ; : */
/* 52 */ KEY_Quote, /* ' " */
/* 53 */ KEY_Tilde, /* ` ~ */
/* 54 */ KEY_Comma, /* , < */
/* 55 */ KEY_Period, /* . > */
/* 56 */ KEY_Slash, /* / ? */
/* 57 */ KEY_CapsLock, /* Caps Lock */
/* 58 */ KEY_F1, /* F1 */
/* 59 */ KEY_F2, /* F2 */
/* 60 */ KEY_F3, /* F3 */
/* 61 */ KEY_F4, /* F4 */
/* 62 */ KEY_F5, /* F5 */
/* 63 */ KEY_F6, /* F6 */
/* 64 */ KEY_F7, /* F7 */
/* 65 */ KEY_F8, /* F8 */
/* 66 */ KEY_F9, /* F9 */
/* 67 */ KEY_F10, /* F10 */
/* 68 */ KEY_F11, /* F11 */
/* 69 */ KEY_F12, /* F12 */
/* 70 */ KEY_Print, /* PrintScrn SysReq */
/* 71 */ KEY_ScrollLock, /* Scroll Lock */
/* 72 */ KEY_Pause, /* Pause Break */
/* 73 */ KEY_Insert, /* Insert XXX Help on some Mac Keyboards */
/* 74 */ KEY_Home, /* Home */
/* 75 */ KEY_PgUp, /* Page Up */
/* 76 */ KEY_Delete, /* Delete */
/* 77 */ KEY_End, /* End */
/* 78 */ KEY_PgDown, /* Page Down */
/* 79 */ KEY_Right, /* Right Arrow */
/* 80 */ KEY_Left, /* Left Arrow */
/* 81 */ KEY_Down, /* Down Arrow */
/* 82 */ KEY_Up, /* Up Arrow */
/* 83 */ KEY_NumLock, /* Num Lock */
/* 84 */ KEY_KP_Divide, /* Keypad / */
/* 85 */ KEY_KP_Multiply, /* Keypad * */
/* 86 */ KEY_KP_Minus, /* Keypad - */
/* 87 */ KEY_KP_Plus, /* Keypad + */
/* 88 */ KEY_KP_Enter, /* Keypad Enter */
/* 89 */ KEY_KP_1, /* Keypad 1 End */
/* 90 */ KEY_KP_2, /* Keypad 2 Down */
/* 91 */ KEY_KP_3, /* Keypad 3 Pg Down */
/* 92 */ KEY_KP_4, /* Keypad 4 Left */
/* 93 */ KEY_KP_5, /* Keypad 5 */
/* 94 */ KEY_KP_6, /* Keypad 6 */
/* 95 */ KEY_KP_7, /* Keypad 7 Home */
/* 96 */ KEY_KP_8, /* Keypad 8 Up */
/* 97 */ KEY_KP_9, /* KEypad 9 Pg Up */
/* 98 */ KEY_KP_0, /* Keypad 0 Ins */
/* 99 */ KEY_KP_Decimal, /* Keypad . Del */
/* 100 */ KEY_Less, /* < > on some keyboards */
/* 101 */ KEY_Menu, /* Menu */
/* 102 */ KEY_Power, /* Sun: Power */
/* 103 */ KEY_KP_Equal, /* Keypad = on Mac keyboards */
/* 104 */ KEY_NOTUSED,
/* 105 */ KEY_NOTUSED,
/* 106 */ KEY_NOTUSED,
/* 107 */ KEY_NOTUSED,
/* 108 */ KEY_NOTUSED,
/* 109 */ KEY_NOTUSED,
/* 110 */ KEY_NOTUSED,
/* 111 */ KEY_NOTUSED,
/* 112 */ KEY_NOTUSED,
/* 113 */ KEY_NOTUSED,
/* 114 */ KEY_NOTUSED,
/* 115 */ KEY_NOTUSED,
/* 116 */ KEY_L7, /* Sun: Open */
/* 117 */ KEY_Help, /* Sun: Help */
/* 118 */ KEY_L3, /* Sun: Props */
/* 119 */ KEY_L5, /* Sun: Front */
/* 120 */ KEY_L1, /* Sun: Stop */
/* 121 */ KEY_L2, /* Sun: Again */
/* 122 */ KEY_L4, /* Sun: Undo */
/* 123 */ KEY_L10, /* Sun: Cut */
/* 124 */ KEY_L6, /* Sun: Copy */
/* 125 */ KEY_L8, /* Sun: Paste */
/* 126 */ KEY_L9, /* Sun: Find */
/* 127 */ KEY_Mute, /* Sun: AudioMute */
/* 128 */ KEY_AudioRaise, /* Sun: AudioRaise */
/* 129 */ KEY_AudioLower, /* Sun: AudioLower */
/* 130 */ KEY_NOTUSED,
/* 131 */ KEY_NOTUSED,
/* 132 */ KEY_NOTUSED,
/* 133 */ KEY_NOTUSED,
/* 134 */ KEY_NOTUSED,
/* 135 */ KEY_BSlash2, /* Sun Japanese Kbd: Backslash / Underscore */
/* 136 */ KEY_HKTG, /* Sun Japanese type7 Kbd: Hirugana/Katakana */
/* 137 */ KEY_Yen, /* Sun Japanese Kbd: Yen / Brokenbar */
/* 138 */ KEY_XFER, /* Sun Japanese Kbd: Kanji Transfer */
/* 139 */ KEY_NFER, /* Sun Japanese Kbd: No Kanji Transfer */
/* 140 */ KEY_NOTUSED,
/* 141 */ KEY_NOTUSED,
/* 142 */ KEY_NOTUSED,
/* 143 */ KEY_NOTUSED,
/* 144 */ KEY_Hangul, /* Korean 106 Kbd: Hangul */
/* 145 */ KEY_Hangul_Hanja, /* Korean 106 Kbd: Hanja */
/* 146 */ KEY_NOTUSED,
/* 147 */ KEY_NOTUSED,
/* 148 */ KEY_NOTUSED,
/* 149 */ KEY_NOTUSED,
/* 150 */ KEY_NOTUSED,
/* 151 */ KEY_NOTUSED,
/* 152 */ KEY_NOTUSED,
/* 153 */ KEY_NOTUSED,
/* 154 */ KEY_NOTUSED,
/* 155 */ KEY_NOTUSED,
/* 156 */ KEY_NOTUSED,
/* 157 */ KEY_NOTUSED,
/* 158 */ KEY_NOTUSED,
/* 159 */ KEY_NOTUSED,
/* 160 */ KEY_NOTUSED,
/* 161 */ KEY_NOTUSED,
/* 162 */ KEY_NOTUSED,
/* 163 */ KEY_NOTUSED,
/* 164 */ KEY_NOTUSED,
/* 165 */ KEY_NOTUSED,
/* 166 */ KEY_NOTUSED,
/* 167 */ KEY_NOTUSED,
/* 168 */ KEY_NOTUSED,
/* 169 */ KEY_NOTUSED,
/* 170 */ KEY_NOTUSED,
/* 171 */ KEY_NOTUSED,
/* 172 */ KEY_NOTUSED,
/* 173 */ KEY_NOTUSED,
/* 174 */ KEY_NOTUSED,
/* 175 */ KEY_NOTUSED,
/* 176 */ KEY_NOTUSED,
/* 177 */ KEY_NOTUSED,
/* 178 */ KEY_NOTUSED,
/* 179 */ KEY_NOTUSED,
/* 180 */ KEY_NOTUSED,
/* 181 */ KEY_NOTUSED,
/* 182 */ KEY_NOTUSED,
/* 183 */ KEY_NOTUSED,
/* 184 */ KEY_NOTUSED,
/* 185 */ KEY_NOTUSED,
/* 186 */ KEY_NOTUSED,
/* 187 */ KEY_NOTUSED,
/* 188 */ KEY_NOTUSED,
/* 189 */ KEY_NOTUSED,
/* 190 */ KEY_NOTUSED,
/* 191 */ KEY_NOTUSED,
/* 192 */ KEY_NOTUSED,
/* 193 */ KEY_NOTUSED,
/* 194 */ KEY_NOTUSED,
/* 195 */ KEY_NOTUSED,
/* 196 */ KEY_NOTUSED,
/* 197 */ KEY_NOTUSED,
/* 198 */ KEY_NOTUSED,
/* 199 */ KEY_NOTUSED,
/* 200 */ KEY_NOTUSED,
/* 201 */ KEY_NOTUSED,
/* 202 */ KEY_NOTUSED,
/* 203 */ KEY_NOTUSED,
/* 204 */ KEY_NOTUSED,
/* 205 */ KEY_NOTUSED,
/* 206 */ KEY_NOTUSED,
/* 207 */ KEY_NOTUSED,
/* 208 */ KEY_NOTUSED,
/* 209 */ KEY_NOTUSED,
/* 210 */ KEY_NOTUSED,
/* 211 */ KEY_NOTUSED,
/* 212 */ KEY_NOTUSED,
/* 213 */ KEY_NOTUSED,
/* 214 */ KEY_NOTUSED,
/* 215 */ KEY_NOTUSED,
/* 216 */ KEY_NOTUSED,
/* 217 */ KEY_NOTUSED,
/* 218 */ KEY_NOTUSED,
/* 219 */ KEY_NOTUSED,
/* 220 */ KEY_NOTUSED,
/* 221 */ KEY_NOTUSED,
/* 222 */ KEY_NOTUSED,
/* 223 */ KEY_NOTUSED,
/* 224 */ KEY_LCtrl, /* Left Control */
/* 225 */ KEY_ShiftL, /* Left Shift */
/* 226 */ KEY_Alt, /* Left Alt */
/* 227 */ KEY_LMeta, /* Left Meta */
/* 228 */ KEY_RCtrl, /* Right Control */
/* 229 */ KEY_ShiftR, /* Right Shift */
/* 230 */ KEY_AltLang, /* Right Alt, AKA AltGr */
/* 231 */ KEY_RMeta, /* Right Meta */
};
static
TransMapRec usbTransMap = {
0,
(sizeof(usbmap)/sizeof(unsigned char)),
usbmap
};
#endif /* KB_USB */
_X_HIDDEN void
KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
{
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
sunKbdPrivPtr priv = (sunKbdPrivPtr) pKbd->private;
int i;
KeySym *k;
#if defined(KB_USB)
if (priv->ktype == KB_USB)
pKbd->scancodeMap = &usbTransMap;
else
#endif
pKbd->scancodeMap = &sunTransMap;
/*
* Add Sun keyboard keysyms to default map
*/
#define map_for_key(k,c) map[(k * GLYPHS_PER_KEY) + c]
map_for_key(KEY_Power, 0) = SunXK_PowerSwitch;
map_for_key(KEY_Power, 1) = SunXK_PowerSwitchShift;
map_for_key(KEY_Mute, 0) = SunXK_AudioMute;
map_for_key(KEY_Mute, 1) = SunXK_VideoDegauss;
map_for_key(KEY_AudioLower, 0) = SunXK_AudioLowerVolume;
map_for_key(KEY_AudioLower, 1) = SunXK_VideoLowerBrightness;
map_for_key(KEY_AudioRaise, 0) = SunXK_AudioRaiseVolume;
map_for_key(KEY_AudioRaise, 1) = SunXK_VideoRaiseBrightness;
map_for_key(KEY_Help, 0) = XK_Help;
map_for_key(KEY_L1, 0) = XK_L1;
map_for_key(KEY_L2, 0) = XK_L2;
map_for_key(KEY_L3, 0) = XK_L3;
map_for_key(KEY_L4, 0) = XK_L4;
map_for_key(KEY_L5, 0) = XK_L5;
map_for_key(KEY_L6, 0) = XK_L6;
map_for_key(KEY_L7, 0) = XK_L7;
map_for_key(KEY_L8, 0) = XK_L8;
map_for_key(KEY_L9, 0) = XK_L9;
map_for_key(KEY_L10, 0) = XK_L10;
map_for_key(KEY_F11, 0) = SunXK_F36;
map_for_key(KEY_F12, 0) = SunXK_F37;
map_for_key(KEY_Menu, 0) = XK_Multi_key;
/*
* compute the modifier map
*/
for (i = 0; i < MAP_LENGTH; i++)
pModMap[i] = NoSymbol; /* make sure it is restored */
for (k = map, i = MIN_KEYCODE;
i < (NUM_KEYCODES + MIN_KEYCODE);
i++, k += 4)
{
switch(*k) {
case XK_Shift_L:
case XK_Shift_R:
pModMap[i] = ShiftMask;
break;
case XK_Control_L:
case XK_Control_R:
pModMap[i] = ControlMask;
break;
case XK_Caps_Lock:
pModMap[i] = LockMask;
break;
case XK_Alt_L:
case XK_Alt_R:
pModMap[i] = AltMask;
break;
case XK_Num_Lock:
pModMap[i] = NumLockMask;
break;
case XK_Scroll_Lock:
pModMap[i] = ScrollLockMask;
break;
/* kana support */
case XK_Kana_Lock:
case XK_Kana_Shift:
pModMap[i] = KanaMask;
break;
/* alternate toggle for multinational support */
case XK_Mode_switch:
pModMap[i] = AltLangMask;
break;
}
}
pKeySyms->map = map;
pKeySyms->mapWidth = GLYPHS_PER_KEY;
pKeySyms->minKeyCode = MIN_KEYCODE;
pKeySyms->maxKeyCode = MAX_KEYCODE;
}

View file

@ -0,0 +1,167 @@
/*
* Copyright (c) 1994-2002 by The XFree86 Project, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of the copyright holder(s)
* and author(s) shall not be used in advertising or otherwise to promote
* the sale, use or other dealings in this Software without prior written
* authorization from the copyright holder(s) and author(s).
*/
/*
*
* For Scancodes see notes in atKeynames.h !!!!
*
*/
#include "xorg-server.h"
static KeySym map[NUM_KEYCODES * GLYPHS_PER_KEY] = {
/* 0x00 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
/* 0x01 */ XK_Escape, NoSymbol, NoSymbol, NoSymbol,
/* 0x02 */ XK_1, XK_exclam, NoSymbol, NoSymbol,
/* 0x03 */ XK_2, XK_at, NoSymbol, NoSymbol,
/* 0x04 */ XK_3, XK_numbersign, NoSymbol, NoSymbol,
/* 0x05 */ XK_4, XK_dollar, NoSymbol, NoSymbol,
/* 0x06 */ XK_5, XK_percent, NoSymbol, NoSymbol,
/* 0x07 */ XK_6, XK_asciicircum, NoSymbol, NoSymbol,
/* 0x08 */ XK_7, XK_ampersand, NoSymbol, NoSymbol,
/* 0x09 */ XK_8, XK_asterisk, NoSymbol, NoSymbol,
/* 0x0a */ XK_9, XK_parenleft, NoSymbol, NoSymbol,
/* 0x0b */ XK_0, XK_parenright, NoSymbol, NoSymbol,
/* 0x0c */ XK_minus, XK_underscore, NoSymbol, NoSymbol,
/* 0x0d */ XK_equal, XK_plus, NoSymbol, NoSymbol,
/* 0x0e */ XK_BackSpace, NoSymbol, NoSymbol, NoSymbol,
/* 0x0f */ XK_Tab, XK_ISO_Left_Tab,NoSymbol, NoSymbol,
/* 0x10 */ XK_Q, NoSymbol, NoSymbol, NoSymbol,
/* 0x11 */ XK_W, NoSymbol, NoSymbol, NoSymbol,
/* 0x12 */ XK_E, NoSymbol, NoSymbol, NoSymbol,
/* 0x13 */ XK_R, NoSymbol, NoSymbol, NoSymbol,
/* 0x14 */ XK_T, NoSymbol, NoSymbol, NoSymbol,
/* 0x15 */ XK_Y, NoSymbol, NoSymbol, NoSymbol,
/* 0x16 */ XK_U, NoSymbol, NoSymbol, NoSymbol,
/* 0x17 */ XK_I, NoSymbol, NoSymbol, NoSymbol,
/* 0x18 */ XK_O, NoSymbol, NoSymbol, NoSymbol,
/* 0x19 */ XK_P, NoSymbol, NoSymbol, NoSymbol,
/* 0x1a */ XK_bracketleft, XK_braceleft, NoSymbol, NoSymbol,
/* 0x1b */ XK_bracketright,XK_braceright, NoSymbol, NoSymbol,
/* 0x1c */ XK_Return, NoSymbol, NoSymbol, NoSymbol,
/* 0x1d */ XK_Control_L, NoSymbol, NoSymbol, NoSymbol,
/* 0x1e */ XK_A, NoSymbol, NoSymbol, NoSymbol,
/* 0x1f */ XK_S, NoSymbol, NoSymbol, NoSymbol,
/* 0x20 */ XK_D, NoSymbol, NoSymbol, NoSymbol,
/* 0x21 */ XK_F, NoSymbol, NoSymbol, NoSymbol,
/* 0x22 */ XK_G, NoSymbol, NoSymbol, NoSymbol,
/* 0x23 */ XK_H, NoSymbol, NoSymbol, NoSymbol,
/* 0x24 */ XK_J, NoSymbol, NoSymbol, NoSymbol,
/* 0x25 */ XK_K, NoSymbol, NoSymbol, NoSymbol,
/* 0x26 */ XK_L, NoSymbol, NoSymbol, NoSymbol,
/* 0x27 */ XK_semicolon, XK_colon, NoSymbol, NoSymbol,
/* 0x28 */ XK_quoteright, XK_quotedbl, NoSymbol, NoSymbol,
/* 0x29 */ XK_quoteleft, XK_asciitilde, NoSymbol, NoSymbol,
/* 0x2a */ XK_Shift_L, NoSymbol, NoSymbol, NoSymbol,
/* 0x2b */ XK_backslash, XK_bar, NoSymbol, NoSymbol,
/* 0x2c */ XK_Z, NoSymbol, NoSymbol, NoSymbol,
/* 0x2d */ XK_X, NoSymbol, NoSymbol, NoSymbol,
/* 0x2e */ XK_C, NoSymbol, NoSymbol, NoSymbol,
/* 0x2f */ XK_V, NoSymbol, NoSymbol, NoSymbol,
/* 0x30 */ XK_B, NoSymbol, NoSymbol, NoSymbol,
/* 0x31 */ XK_N, NoSymbol, NoSymbol, NoSymbol,
/* 0x32 */ XK_M, NoSymbol, NoSymbol, NoSymbol,
/* 0x33 */ XK_comma, XK_less, NoSymbol, NoSymbol,
/* 0x34 */ XK_period, XK_greater, NoSymbol, NoSymbol,
/* 0x35 */ XK_slash, XK_question, NoSymbol, NoSymbol,
/* 0x36 */ XK_Shift_R, NoSymbol, NoSymbol, NoSymbol,
/* 0x37 */ XK_KP_Multiply, NoSymbol, NoSymbol, NoSymbol,
/* 0x38 */ XK_Alt_L, XK_Meta_L, NoSymbol, NoSymbol,
/* 0x39 */ XK_space, NoSymbol, NoSymbol, NoSymbol,
/* 0x3a */ XK_Caps_Lock, NoSymbol, NoSymbol, NoSymbol,
/* 0x3b */ XK_F1, NoSymbol, NoSymbol, NoSymbol,
/* 0x3c */ XK_F2, NoSymbol, NoSymbol, NoSymbol,
/* 0x3d */ XK_F3, NoSymbol, NoSymbol, NoSymbol,
/* 0x3e */ XK_F4, NoSymbol, NoSymbol, NoSymbol,
/* 0x3f */ XK_F5, NoSymbol, NoSymbol, NoSymbol,
/* 0x40 */ XK_F6, NoSymbol, NoSymbol, NoSymbol,
/* 0x41 */ XK_F7, NoSymbol, NoSymbol, NoSymbol,
/* 0x42 */ XK_F8, NoSymbol, NoSymbol, NoSymbol,
/* 0x43 */ XK_F9, NoSymbol, NoSymbol, NoSymbol,
/* 0x44 */ XK_F10, NoSymbol, NoSymbol, NoSymbol,
/* 0x45 */ XK_Num_Lock, NoSymbol, NoSymbol, NoSymbol,
/* 0x46 */ XK_Scroll_Lock, NoSymbol, NoSymbol, NoSymbol,
/* 0x47 */ XK_KP_Home, XK_KP_7, NoSymbol, NoSymbol,
/* 0x48 */ XK_KP_Up, XK_KP_8, NoSymbol, NoSymbol,
/* 0x49 */ XK_KP_Prior, XK_KP_9, NoSymbol, NoSymbol,
/* 0x4a */ XK_KP_Subtract, NoSymbol, NoSymbol, NoSymbol,
/* 0x4b */ XK_KP_Left, XK_KP_4, NoSymbol, NoSymbol,
/* 0x4c */ XK_KP_Begin, XK_KP_5, NoSymbol, NoSymbol,
/* 0x4d */ XK_KP_Right, XK_KP_6, NoSymbol, NoSymbol,
/* 0x4e */ XK_KP_Add, NoSymbol, NoSymbol, NoSymbol,
/* 0x4f */ XK_KP_End, XK_KP_1, NoSymbol, NoSymbol,
/* 0x50 */ XK_KP_Down, XK_KP_2, NoSymbol, NoSymbol,
/* 0x51 */ XK_KP_Next, XK_KP_3, NoSymbol, NoSymbol,
/* 0x52 */ XK_KP_Insert, XK_KP_0, NoSymbol, NoSymbol,
/* 0x53 */ XK_KP_Delete, XK_KP_Decimal, NoSymbol, NoSymbol,
/* 0x54 */ XK_Sys_Req, NoSymbol, NoSymbol, NoSymbol,
/* 0x55 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
/* 0x56 */ XK_less, XK_greater, NoSymbol, NoSymbol,
/* 0x57 */ XK_F11, NoSymbol, NoSymbol, NoSymbol,
/* 0x58 */ XK_F12, NoSymbol, NoSymbol, NoSymbol,
/* 0x59 */ XK_Home, NoSymbol, NoSymbol, NoSymbol,
/* 0x5a */ XK_Up, NoSymbol, NoSymbol, NoSymbol,
/* 0x5b */ XK_Prior, NoSymbol, NoSymbol, NoSymbol,
/* 0x5c */ XK_Left, NoSymbol, NoSymbol, NoSymbol,
/* 0x5d */ XK_Begin, NoSymbol, NoSymbol, NoSymbol,
/* 0x5e */ XK_Right, NoSymbol, NoSymbol, NoSymbol,
/* 0x5f */ XK_End, NoSymbol, NoSymbol, NoSymbol,
/* 0x60 */ XK_Down, NoSymbol, NoSymbol, NoSymbol,
/* 0x61 */ XK_Next, NoSymbol, NoSymbol, NoSymbol,
/* 0x62 */ XK_Insert, NoSymbol, NoSymbol, NoSymbol,
/* 0x63 */ XK_Delete, NoSymbol, NoSymbol, NoSymbol,
/* 0x64 */ XK_KP_Enter, NoSymbol, NoSymbol, NoSymbol,
/* 0x65 */ XK_Control_R, NoSymbol, NoSymbol, NoSymbol,
/* 0x66 */ XK_Pause, NoSymbol, NoSymbol, NoSymbol,
/* 0x67 */ XK_Print, NoSymbol, NoSymbol, NoSymbol,
/* 0x68 */ XK_KP_Divide, NoSymbol, NoSymbol, NoSymbol,
/* 0x69 */ XK_Alt_R, XK_Meta_R, NoSymbol, NoSymbol,
/* 0x6a */ XK_Break, NoSymbol, NoSymbol, NoSymbol,
/* 0x6b */ XK_Meta_L, NoSymbol, NoSymbol, NoSymbol,
/* 0x6c */ XK_Meta_R, NoSymbol, NoSymbol, NoSymbol,
/* 0x6d */ XK_Menu, NoSymbol, NoSymbol, NoSymbol,
/* 0x6e */ XK_F13, NoSymbol, NoSymbol, NoSymbol,
/* 0x6f */ XK_F14, NoSymbol, NoSymbol, NoSymbol,
/* 0x70 */ XK_F15, NoSymbol, NoSymbol, NoSymbol,
/* 0x71 */ XK_F16, NoSymbol, NoSymbol, NoSymbol,
/* 0x72 */ XK_F17, NoSymbol, NoSymbol, NoSymbol,
/* 0x73 */ XK_backslash, XK_underscore, NoSymbol, NoSymbol,
/* 0x74 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
/* 0x75 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
/* 0x76 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
/* 0x77 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
/* 0x78 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
/* 0x79 */ XK_Henkan, XK_Mode_switch, NoSymbol, NoSymbol,
/* 0x7a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
/* 0x7b */ XK_Muhenkan, NoSymbol, NoSymbol, NoSymbol,
/* 0x7c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
/* 0x7d */ XK_backslash, XK_bar, NoSymbol, NoSymbol,
/* 0x7e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
/* 0x7f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
};

View file

@ -0,0 +1,100 @@
/*
* Copyright (c) 2002-2003 by The XFree86 Project, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of the copyright holder(s)
* and author(s) shall not be used in advertising or otherwise to promote
* the sale, use or other dealings in this Software without prior written
* authorization from the copyright holder(s) and author(s).
*
* Author: Ivan Pascal.
*/
#include "xf86Xinput.h"
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 18
#define LogMessageVerbSigSafe xf86MsgVerb
#endif
Bool ATScancode(InputInfoPtr pInfo, int *scanCode);
/* Public interface to OS-specific keyboard support. */
typedef int (*KbdInitProc)(InputInfoPtr pInfo, int what);
typedef int (*KbdOnProc)(InputInfoPtr pInfo, int what);
typedef int (*KbdOffProc)(InputInfoPtr pInfo, int what);
typedef void (*BellProc)(InputInfoPtr pInfo,
int loudness, int pitch, int duration);
typedef void (*SetLedsProc)(InputInfoPtr pInfo, int leds);
typedef int (*GetLedsProc)(InputInfoPtr pInfo);
typedef void (*KbdGetMappingProc)(InputInfoPtr pInfo,
KeySymsPtr pKeySyms, CARD8* pModMap);
typedef int (*RemapScanCodeProc)(InputInfoPtr pInfo, int *scanCode);
typedef Bool (*OpenKeyboardProc)(InputInfoPtr pInfo);
typedef void (*PostEventProc)(InputInfoPtr pInfo,
unsigned int key, Bool down);
typedef struct {
int begin;
int end;
unsigned char *map;
} TransMapRec, *TransMapPtr;
typedef struct {
KbdInitProc KbdInit;
KbdOnProc KbdOn;
KbdOffProc KbdOff;
BellProc Bell;
SetLedsProc SetLeds;
GetLedsProc GetLeds;
KbdGetMappingProc KbdGetMapping;
RemapScanCodeProc RemapScanCode;
OpenKeyboardProc OpenKeyboard;
PostEventProc PostEvent;
unsigned long leds;
unsigned long xledsMask;
unsigned long keyLeds;
int scanPrefix;
Bool CustomKeycodes;
Bool isConsole;
TransMapPtr scancodeMap;
TransMapPtr specialMap;
/* os specific */
pointer private;
int consType;
int wsKbdType;
char wsKbdDev[256];
} KbdDevRec, *KbdDevPtr;
typedef enum {
PROT_STD,
PROT_WSCONS,
PROT_UNKNOWN_KBD
} KbdProtocolId;
typedef struct {
const char *name;
KbdProtocolId id;
} KbdProtocolRec;
_X_EXPORT Bool xf86OSKbdPreInit(InputInfoPtr pInfo);