xf86-input-keyboard 1.3.1
This commit is contained in:
parent
5e5620f8d4
commit
d1a95433ea
@ -1,12 +1,230 @@
|
||||
This is a stub file. This package has not yet had its complete licensing
|
||||
information compiled. Please see the individual source files for details on
|
||||
your rights to use and modify this software.
|
||||
Code common to all operating systems is covered by these notices:
|
||||
|
||||
Please submit updated COPYING files to the Xorg bugzilla:
|
||||
Copyright (c) 1992-2003 by The XFree86 Project, Inc.
|
||||
Copyright 1997 by Metro Link, Inc.
|
||||
|
||||
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
|
||||
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:
|
||||
|
||||
All licensing questions regarding this software should be directed at the
|
||||
Xorg mailing list:
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
http://lists.freedesktop.org/mailman/listinfo/xorg
|
||||
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).
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
Code for BSD operating systems is additionally covered by this notice:
|
||||
|
||||
Copyright 1992 by Rich Murphey <Rich@Rice.edu>
|
||||
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 Rich Murphey and David Dawes
|
||||
not be used in advertising or publicity pertaining to distribution of
|
||||
the software without specific, written prior permission. Rich Murphey 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.
|
||||
|
||||
RICH MURPHEY AND DAVID DAWES DISCLAIM ALL WARRANTIES WITH REGARD TO
|
||||
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL RICH MURPHEY 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.
|
||||
|
||||
|
||||
|
||||
Code for the GNU Hurd operating system is additionally covered by this notice:
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
Code for Linux operating systems is additionally covered by these notices:
|
||||
|
||||
Based on the code from lnx_io.c which is
|
||||
Copyright 1992 by Orest Zborowski <obz@Kodak.com>
|
||||
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 Orest Zborowski and David Dawes
|
||||
not be used in advertising or publicity pertaining to distribution of
|
||||
the software without specific, written prior permission. Orest Zborowski
|
||||
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.
|
||||
|
||||
OREST ZBOROWSKI AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD
|
||||
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI 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.
|
||||
|
||||
Portions based on kbdrate.c from util-linux 2.9t, which is
|
||||
Copyright 1992 Rickard E. Faith. Distributed under the GPL.
|
||||
This program comes with ABSOLUTELY NO WARRANTY.
|
||||
|
||||
|
||||
|
||||
Code for SCO operating systems is additionally covered by these notices:
|
||||
|
||||
Copyright 2003, 2005 by J. Kean Johnston <jkj@sco.com>
|
||||
|
||||
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 J. Kean Johnston not be used in
|
||||
advertising or publicity pertaining to distribution of the software without
|
||||
specific, written prior permission. J. Kean Johnston makes no
|
||||
representations about the suitability of this software for any purpose.
|
||||
It is provided "as is" without express or implied warranty.
|
||||
|
||||
J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
EVENT SHALL J. KEAN JOHNSTON 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.
|
||||
|
||||
Based on lnx_kbd.c which is
|
||||
Copyright 1992 by Orest Zborowski <obz@Kodak.com>
|
||||
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 Orest Zborowski and David Dawes
|
||||
not be used in advertising or publicity pertaining to distribution of
|
||||
the software without specific, written prior permission. Orest Zborowski
|
||||
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.
|
||||
|
||||
OREST ZBOROWSKI AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD
|
||||
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI 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.
|
||||
|
||||
|
||||
|
||||
Code for Solaris operating systems is additionally covered by these notices:
|
||||
|
||||
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 2004-2007 Sun Microsystems, Inc. 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, and/or sell copies of the Software, and to permit persons
|
||||
to whom the Software is furnished to do so, provided that the above
|
||||
copyright notice(s) and this permission notice appear in all copies of
|
||||
the Software and that both the above copyright notice(s) and this
|
||||
permission notice appear in supporting documentation.
|
||||
|
||||
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
|
||||
OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
|
||||
|
||||
Except as contained in this notice, the name of a copyright holder
|
||||
shall not be used in advertising or otherwise to promote the sale, use
|
||||
or other dealings in this Software without prior written authorization
|
||||
of the copyright holder.
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT([xf86-input-keyboard],
|
||||
1.2.2,
|
||||
1.3.1,
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
||||
xf86-input-keyboard)
|
||||
|
||||
|
@ -40,12 +40,16 @@ SED = sed
|
||||
XORGRELSTRING = @PACKAGE_STRING@
|
||||
XORGMANNAME = X Version 11
|
||||
|
||||
# should allow configure override like xserver's configure.ac does
|
||||
XKBPATH=${datadir}/X11/xkb
|
||||
|
||||
MAN_SUBSTS = \
|
||||
-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
|
||||
-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
|
||||
-e 's|__xservername__|Xorg|g' \
|
||||
-e 's|__xconfigfile__|xorg.conf|g' \
|
||||
-e 's|__projectroot__|$(prefix)|g' \
|
||||
-e 's|__xkb_path__|$(XKBPATH)|g' \
|
||||
-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
|
||||
-e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \
|
||||
-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
|
||||
|
@ -17,10 +17,10 @@ kbd \- Keyboard input driver
|
||||
.B kbd
|
||||
is an __xservername__ input driver for keyboards. The driver supports the standard
|
||||
OS-provided keyboard interface, but these are currently only available to
|
||||
this driver module for Linux, BSD, and Solaris. This driver is planned to
|
||||
replace the built-in
|
||||
this driver module for Linux, BSD, and Solaris. This driver is the
|
||||
replacement for the built-in
|
||||
.B keyboard
|
||||
driver in a future release of __xservername__.
|
||||
driver formerly included in __xservername__.
|
||||
.PP
|
||||
The
|
||||
.B kbd
|
||||
@ -73,7 +73,11 @@ specifies which XKB rules file to use for interpreting the
|
||||
and
|
||||
.B XkbOptions
|
||||
settings. Default: "xorg" for most platforms, but "xfree98" for the
|
||||
Japanese PC-98 platforms.
|
||||
Japanese PC-98 platforms. If you use the "xorg" value then you can
|
||||
find listing of all valid values for these four options in the
|
||||
.I
|
||||
__xkb_path__/rules/xorg.lst
|
||||
file.
|
||||
.TP 7
|
||||
.BI "Option \*qXkbModel\*q \*q" modelname \*q
|
||||
specifies the XKB keyboard model name. Default: "pc105" for most platforms,
|
||||
@ -95,5 +99,41 @@ enhance the keyboard behaviour. Default: not set.
|
||||
Some other XKB-related options are available, but they are incompatible
|
||||
with the ones listed above and are not recommended, so they are not
|
||||
documented here.
|
||||
.SH EXAMPLE
|
||||
The following xorg.conf fragment ensures that user will be able to switch between
|
||||
.I us
|
||||
and
|
||||
.I sk
|
||||
layouts by pressing the "menu" key.
|
||||
.PP
|
||||
The
|
||||
.B XkbVariant
|
||||
option defines which variants of the two layouts should be used. In case of the
|
||||
.I us
|
||||
layout
|
||||
its default variant is used. In case of the
|
||||
.I sk
|
||||
layout
|
||||
its
|
||||
.I qwerty
|
||||
variant is used.
|
||||
.PP
|
||||
.nf
|
||||
.RS 4
|
||||
Section \*qInputDevice\*q
|
||||
.RS 4
|
||||
Identifier "Generic Keyboard"
|
||||
Driver "kbd"
|
||||
Option "CoreKeyboard"
|
||||
Option "XkbRules" "xorg"
|
||||
Option "XkbModel" "pc105"
|
||||
Option "XkbLayout" "us,sk"
|
||||
Option "XkbVariant" ",qwerty"
|
||||
Option "XkbOptions" "grp:menu_toggle,grp_led:scroll"
|
||||
.RE
|
||||
EndSection
|
||||
.RE
|
||||
.fi
|
||||
.SH "SEE ALSO"
|
||||
keyboard(__drivermansuffix__), __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__).
|
||||
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__),
|
||||
xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__).
|
||||
|
@ -59,6 +59,8 @@ extern int XkbDfltRepeatInterval;
|
||||
#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 (1 << 31)
|
||||
|
||||
static InputInfoPtr KbdPreInit(InputDriverPtr drv, IDevPtr dev, int flags);
|
||||
static int KbdProc(DeviceIntPtr device, int what);
|
||||
@ -477,10 +479,9 @@ InitKBD(InputInfoPtr pInfo, Bool init)
|
||||
pKbd->scanPrefix = 0;
|
||||
|
||||
if (init) {
|
||||
pKbd->keyLeds = 0;
|
||||
|
||||
pKbd->keyLeds = pKbd->GetLeds(pInfo);
|
||||
UpdateLeds(pInfo);
|
||||
|
||||
pKbd->keyLeds |= INITFLAG;
|
||||
if( pKbd->delay <= 375) rad = 0x00;
|
||||
else if (pKbd->delay <= 625) rad = 0x20;
|
||||
else if (pKbd->delay <= 875) rad = 0x40;
|
||||
@ -489,8 +490,22 @@ InitKBD(InputInfoPtr pInfo, Bool init)
|
||||
else if (pKbd->rate >= 30) rad |= 0x00;
|
||||
else rad |= ((58 / pKbd->rate) - 2);
|
||||
pKbd->SetKbdRepeat(pInfo, rad);
|
||||
} else
|
||||
} else {
|
||||
int 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
|
||||
@ -550,7 +565,6 @@ KbdProc(DeviceIntPtr device, int what)
|
||||
* passing on parts of the VT switch sequence.
|
||||
*/
|
||||
if (pInfo->fd >= 0) {
|
||||
sleep(1);
|
||||
xf86FlushInput(pInfo->fd);
|
||||
AddEnabledDevice(pInfo->fd);
|
||||
}
|
||||
|
@ -59,7 +59,6 @@
|
||||
#include "xf86_OSlib.h"
|
||||
#include "xf86OSKbd.h"
|
||||
#include "sun_kbd.h"
|
||||
#include "atKeynames.h"
|
||||
|
||||
#include <sys/stropts.h>
|
||||
#include <sys/vuid_event.h>
|
||||
@ -208,42 +207,6 @@ KbdOn(InputInfoPtr pInfo, int what)
|
||||
return BadImplementation;
|
||||
}
|
||||
|
||||
/* If Caps Lock or Num Lock LEDs are on when server starts,
|
||||
* send a fake key down on those keys to set the server state
|
||||
* to match the LED's.
|
||||
*/
|
||||
if ( priv->oleds & (LED_CAPS_LOCK | LED_NUM_LOCK) ) {
|
||||
int capslock = -1;
|
||||
int numlock = -1;
|
||||
int j;
|
||||
TransMapPtr kmap = pKbd->scancodeMap;
|
||||
|
||||
for (j = kmap->begin; j < kmap->end ; j++) {
|
||||
switch (kmap->map[j]) {
|
||||
case KEY_CapsLock:
|
||||
capslock = j;
|
||||
break;
|
||||
case KEY_NumLock:
|
||||
numlock = j;
|
||||
break;
|
||||
default:
|
||||
/* nothing to do */
|
||||
break;
|
||||
}
|
||||
if ((capslock >= 0) && (numlock >= 0)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((priv->oleds & LED_CAPS_LOCK) && (capslock > 0)) {
|
||||
pKbd->PostEvent(pInfo, capslock, TRUE); /* Press */
|
||||
pKbd->PostEvent(pInfo, capslock, FALSE); /* Release */
|
||||
}
|
||||
if ((priv->oleds & LED_NUM_LOCK) && (numlock > 0)) {
|
||||
pKbd->PostEvent(pInfo, numlock, TRUE); /* Press */
|
||||
pKbd->PostEvent(pInfo, numlock, FALSE); /* Release */
|
||||
}
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
@ -301,9 +264,39 @@ SoundKbdBell(InputInfoPtr pInfo, int loudness, int pitch, int duration)
|
||||
sunKbdPrivPtr priv = (sunKbdPrivPtr) pKbd->private;
|
||||
|
||||
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));
|
||||
|
Loading…
Reference in New Issue
Block a user