Update to xf86-input-keyboard 1.9.0

This commit is contained in:
matthieu 2017-01-22 09:53:08 +00:00
parent b90c377899
commit a8cb3544bb
5 changed files with 169 additions and 150 deletions

View File

@ -1,3 +1,61 @@
commit 0c7f51291f91eee61fcaf05080001a5e9b22fb53
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Thu Nov 17 14:21:48 2016 +1000
keyboard 1.9.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit 157e0631b12d0aae4a5f38b81bee615a7eaf553f
Author: Keith Packard <keithp@keithp.com>
Date: Mon May 30 01:27:49 2016 -0700
Use xf86AddEnabledDevice with threaded input
We didn't use SIGIO input for keyboard processing, but we can use
threaded input.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit 9ab899863a61b800d58e078e936c0d8d88bc0893
Author: Alexandr Shadchin <alexandr.shadchin@gmail.com>
Date: Tue Nov 24 12:46:44 2015 +0500
Remove support for X input ABI < 12
Signed-off-by: Alexandr Shadchin <alexandr.shadchin@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit 0317028c2bd0bfd06efd3c1f192ff9a494757187
Author: Alexandr Shadchin <alexandr.shadchin@gmail.com>
Date: Tue Nov 24 12:46:43 2015 +0500
Reorder load module stuff
Signed-off-by: Alexandr Shadchin <alexandr.shadchin@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit 8096183e9cb79944e322dcc0cd1f9e50c97ad2c8
Author: Alexandr Shadchin <alexandr.shadchin@gmail.com>
Date: Tue Nov 24 12:46:42 2015 +0500
Remove empty function xf86KbdUnplug
Signed-off-by: Alexandr Shadchin <alexandr.shadchin@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit ccf63a61f39e1f107a67c33d6a7ad24ea4c76b7e
Author: Yasushi Oshima <oshima-ya@yagoto-urayama.jp>
Date: Mon Jul 20 10:49:49 2015 +0200
Add defines for Japanese 106-key USB keyboards.
Via http://gnats.netbsd.org/48347
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
commit 13d320076e5de2d6c3cbc170fc7e31c526ed8499
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Apr 7 09:24:38 2015 +1000

View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for xf86-input-keyboard 1.8.1.
# Generated by GNU Autoconf 2.69 for xf86-input-keyboard 1.9.0.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
#
@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='xf86-input-keyboard'
PACKAGE_TARNAME='xf86-input-keyboard'
PACKAGE_VERSION='1.8.1'
PACKAGE_STRING='xf86-input-keyboard 1.8.1'
PACKAGE_VERSION='1.9.0'
PACKAGE_STRING='xf86-input-keyboard 1.9.0'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
PACKAGE_URL=''
@ -1358,7 +1358,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures xf86-input-keyboard 1.8.1 to adapt to many kinds of systems.
\`configure' configures xf86-input-keyboard 1.9.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1429,7 +1429,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of xf86-input-keyboard 1.8.1:";;
short | recursive ) echo "Configuration of xf86-input-keyboard 1.9.0:";;
esac
cat <<\_ACEOF
@ -1553,7 +1553,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
xf86-input-keyboard configure 1.8.1
xf86-input-keyboard configure 1.9.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1877,7 +1877,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by xf86-input-keyboard $as_me 1.8.1, which was
It was created by xf86-input-keyboard $as_me 1.9.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2706,7 +2706,7 @@ fi
# Define the identity of the package.
PACKAGE='xf86-input-keyboard'
VERSION='1.8.1'
VERSION='1.9.0'
cat >>confdefs.h <<_ACEOF
@ -17549,12 +17549,12 @@ if test -n "$XORG_CFLAGS"; then
pkg_cv_XORG_CFLAGS="$XORG_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xorg-server >= 1.4 xproto inputproto\""; } >&5
($PKG_CONFIG --exists --print-errors "xorg-server >= 1.4 xproto inputproto") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xorg-server >= 1.10 xproto inputproto\""; } >&5
($PKG_CONFIG --exists --print-errors "xorg-server >= 1.10 xproto inputproto") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_XORG_CFLAGS=`$PKG_CONFIG --cflags "xorg-server >= 1.4 xproto inputproto" 2>/dev/null`
pkg_cv_XORG_CFLAGS=`$PKG_CONFIG --cflags "xorg-server >= 1.10 xproto inputproto" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@ -17566,12 +17566,12 @@ if test -n "$XORG_LIBS"; then
pkg_cv_XORG_LIBS="$XORG_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xorg-server >= 1.4 xproto inputproto\""; } >&5
($PKG_CONFIG --exists --print-errors "xorg-server >= 1.4 xproto inputproto") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xorg-server >= 1.10 xproto inputproto\""; } >&5
($PKG_CONFIG --exists --print-errors "xorg-server >= 1.10 xproto inputproto") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_XORG_LIBS=`$PKG_CONFIG --libs "xorg-server >= 1.4 xproto inputproto" 2>/dev/null`
pkg_cv_XORG_LIBS=`$PKG_CONFIG --libs "xorg-server >= 1.10 xproto inputproto" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@ -17592,14 +17592,14 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
XORG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xorg-server >= 1.4 xproto inputproto" 2>&1`
XORG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xorg-server >= 1.10 xproto inputproto" 2>&1`
else
XORG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xorg-server >= 1.4 xproto inputproto" 2>&1`
XORG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xorg-server >= 1.10 xproto inputproto" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$XORG_PKG_ERRORS" >&5
as_fn_error $? "Package requirements (xorg-server >= 1.4 xproto inputproto) were not met:
as_fn_error $? "Package requirements (xorg-server >= 1.10 xproto inputproto) were not met:
$XORG_PKG_ERRORS
@ -18272,7 +18272,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by xf86-input-keyboard $as_me 1.8.1, which was
This file was extended by xf86-input-keyboard $as_me 1.9.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -18338,7 +18338,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
xf86-input-keyboard config.status 1.8.1
xf86-input-keyboard config.status 1.9.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-input-keyboard],
[1.8.1],
[1.9.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-input-keyboard])
AC_CONFIG_SRCDIR([Makefile.am])
@ -44,7 +44,7 @@ XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
# Obtain compiler/linker options from server and required extensions
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.4] xproto inputproto)
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto inputproto)
# Define a configure option for an alternate input module directory
AC_ARG_WITH(xorg-module-dir,

View File

@ -345,17 +345,33 @@ static CARD8 wsUsbMap[] = {
/* 132 */ KEY_NOTUSED,
/* 133 */ KEY_NOTUSED,
/* 134 */ KEY_NOTUSED,
/* 135 */ KEY_NOTUSED,
/* 136 */ KEY_NOTUSED,
/* 137 */ KEY_NOTUSED,
/* 138 */ KEY_NOTUSED,
/* 139 */ KEY_NOTUSED,
/*
* Special keycodes for Japanese keyboards
* Override atKeyname HKTG and BSlash2 code to unique values for JP106 keyboards
*/
#undef KEY_HKTG
#define KEY_HKTG 200 /* Japanese Hiragana Katakana Toggle */
#undef KEY_BSlash2
#define KEY_BSlash2 203 /* Japanese '\_' key */
/* 135 */ KEY_BSlash2, /* Japanese 106 kbd: '\_' */
/* 136 */ KEY_HKTG, /* Japanese 106 kbd: Hiragana Katakana toggle */
/* 137 */ KEY_Yen, /* Japanese 106 kbd: '\|' */
/* 138 */ KEY_XFER, /* Japanese 106 kbd: Henkan */
/* 139 */ KEY_NFER, /* Japanese 106 kbd: Muhenkan */
/* 140 */ KEY_NOTUSED,
/* 141 */ KEY_NOTUSED,
/* 142 */ KEY_NOTUSED,
/* 143 */ KEY_NOTUSED,
/* 144 */ KEY_NOTUSED,
/* 145 */ KEY_NOTUSED,
/*
* Special keycodes for Korean keyboards
* Define Hangul and Hangul_Hanja unique key codes
* These keys also use KANA and EISU on some Macintosh Japanese USB keyboards
*/
#define KEY_Hangul 201 /* Also KANA Key on Mac JP USB kbd */
#define KEY_Hangul_Hanja 202 /* Also EISU Key on Mac JP USB kbd */
/* 144 */ KEY_Hangul, /* Korean 106 kbd: Hangul */
/* 145 */ KEY_Hangul_Hanja, /* Korean 106 kbd: Hangul Hanja */
/* 146 */ KEY_NOTUSED,
/* 147 */ KEY_NOTUSED,
/* 148 */ KEY_NOTUSED,

View File

@ -45,6 +45,10 @@
#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
@ -53,11 +57,7 @@
/* Used to know when the first DEVICE_ON after a DEVICE_INIT is called */
#define INITFLAG (1U << 31)
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
static InputInfoPtr KbdPreInit(InputDriverPtr drv, IDevPtr dev, int flags);
#else
static int KbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags);
#endif
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);
@ -66,24 +66,6 @@ static void PostKbdEvent(InputInfoPtr pInfo, unsigned int key, Bool down);
static void InitKBD(InputInfoPtr pInfo, Bool init);
static void UpdateLeds(InputInfoPtr pInfo);
_X_EXPORT InputDriverRec KBD = {
1,
"kbd",
NULL,
KbdPreInit,
NULL,
NULL
};
_X_EXPORT InputDriverRec KEYBOARD = {
1,
"keyboard",
NULL,
KbdPreInit,
NULL,
NULL
};
static const char *kbdDefaults[] = {
#ifdef __NetBSD__
#ifdef DEFAULT_TO_WSKBD
@ -106,43 +88,52 @@ static char *xkb_layout;
static char *xkb_variant;
static char *xkb_options;
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
static int
NewKbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags);
_X_EXPORT InputDriverRec KBD = {
1,
"kbd",
NULL,
KbdPreInit,
NULL,
NULL
};
static InputInfoPtr
KbdPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
_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)
{
InputInfoPtr pInfo;
if (!(pInfo = xf86AllocateInput(drv, 0)))
return NULL;
pInfo->name = dev->identifier;
pInfo->flags = XI86_KEYBOARD_CAPABLE;
pInfo->conversion_proc = NULL;
pInfo->reverse_conversion_proc = NULL;
pInfo->private_flags = 0;
pInfo->always_core_feedback = NULL;
pInfo->conf_idev = dev;
pInfo->close_proc = NULL;
if (NewKbdPreInit(drv, pInfo, flags) == Success)
{
pInfo->flags |= XI86_CONFIGURED;
return pInfo;
}
xf86DeleteInput(pInfo, 0);
return NULL;
xf86AddInputDriver(&KBD, module, 0);
return module;
}
static int
NewKbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
#else
_X_EXPORT XF86ModuleData kbdModuleData = {
&xf86KbdVersionRec,
xf86KbdPlug,
NULL
};
static int
KbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
#endif
{
KbdDevPtr pKbd;
char *s;
@ -163,11 +154,7 @@ KbdPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
pInfo->dev = NULL;
defaults = kbdDefaults;
xf86CollectInputOptions(pInfo, defaults
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
, NULL
#endif
);
xf86CollectInputOptions(pInfo, defaults);
xf86ProcessCommonOptions(pInfo, pInfo->options);
if (!(pKbd = calloc(sizeof(KbdDevRec), 1))) {
@ -309,6 +296,7 @@ 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;
@ -322,9 +310,6 @@ KbdProc(DeviceIntPtr device, int what)
pKbd->KbdGetMapping(pInfo, &keySyms, modMap);
device->public.on = FALSE;
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5
{
XkbRMLVOSet rmlvo;
rmlvo.rules = xkb_rules;
rmlvo.model = xkb_model;
rmlvo.layout = xkb_layout;
@ -339,7 +324,6 @@ KbdProc(DeviceIntPtr device, int what)
return BadValue;
}
}
# ifdef XI_PROP_DEVICE_NODE
{
const char *device_node =
@ -355,17 +339,6 @@ KbdProc(DeviceIntPtr device, int what)
}
}
# endif /* XI_PROP_DEVICE_NODE */
#else
{
XkbComponentNamesRec xkbnames;
memset(&xkbnames, 0, sizeof(xkbnames));
XkbSetRulesDflts(xkb_rules, xkb_model, xkb_layout,
xkb_variant, xkb_options);
XkbInitKeyboardDeviceStruct(device, &xkbnames, &keySyms,
modMap, KbdBell,
(KbdCtrlProcPtr)KbdCtrl);
}
#endif /* XINPUT ABI 5*/
InitKBD(pInfo, TRUE);
break;
case DEVICE_ON:
@ -383,7 +356,11 @@ KbdProc(DeviceIntPtr device, int what)
*/
if (pInfo->fd >= 0) {
xf86FlushInput(pInfo->fd);
#if HAVE_THREADED_INPUT
xf86AddEnabledDevice(pInfo);
#else
AddEnabledDevice(pInfo->fd);
#endif
}
device->public.on = TRUE;
@ -396,8 +373,13 @@ KbdProc(DeviceIntPtr device, int what)
/*
* Restore original keyboard directness and translation.
*/
if (pInfo->fd != -1)
if (pInfo->fd != -1) {
#if HAVE_THREADED_INPUT
xf86RemoveEnabledDevice(pInfo);
#else
RemoveEnabledDevice(pInfo->fd);
#endif
}
pKbd->KbdOff(pInfo, what);
device->public.on = FALSE;
break;
@ -451,40 +433,3 @@ PostKbdEvent(InputInfoPtr pInfo, unsigned int scanCode, Bool down)
xf86PostKeyboardEvent(device, scanCode + MIN_KEYCODE, down);
}
static void
xf86KbdUnplug(pointer p)
{
}
static pointer
xf86KbdPlug(pointer module,
pointer options,
int *errmaj,
int *errmin)
{
xf86AddInputDriver(&KBD, module, 0);
return module;
}
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} /* signature, to be patched into the file by */
/* a tool */
};
_X_EXPORT XF86ModuleData kbdModuleData = {
&xf86KbdVersionRec,
xf86KbdPlug,
xf86KbdUnplug
};