summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-02-11 09:09:59 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-02-11 09:21:14 +1000
commitae630aef17185dd8d2c23d0eb1b3287fa6e26268 (patch)
treea9b095c9d265476fcf07b926975d054fa57512a3
parent74ffb8e1897e7dd73f1adf3a2cba6b4214cfc77a (diff)
Really remove autorepeat.
This strips all autorepeat from the keyboard driver. If you need autorepeat, use XKB. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--man/kbd.man8
-rw-r--r--src/kbd.c20
-rw-r--r--src/lnx_kbd.c146
-rw-r--r--src/xf86OSKbd.h2
4 files changed, 0 insertions, 176 deletions
diff --git a/man/kbd.man b/man/kbd.man
index e651277..564430c 100644
--- a/man/kbd.man
+++ b/man/kbd.man
@@ -55,14 +55,6 @@ Standard, Xqueue.
Not all protocols are supported on all platforms. Default: "Standard".
.RE
.TP 7
-.BI "Option \*qAutoRepeat\*q \*q" "delay rate" \*q
-sets the auto repeat behaviour for the keyboard. This is not implemented
-on all platforms.
-.I delay
-is the time in milliseconds before a key starts repeating.
-.I rate
-is the number of times a key repeats per second. Default: "500 30".
-.TP 7
.BI "Option \*qXLeds\*q \*q" ledlist \*q
makes the keyboard LEDs specified in
.I ledlist
diff --git a/src/kbd.c b/src/kbd.c
index ffb0b63..e89392b 100644
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -242,17 +242,6 @@ KbdPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
return pInfo;
}
- if ((s = xf86SetStrOption(pInfo->options, "AutoRepeat", NULL))) {
- int delay, rate;
- if (sscanf(s, "%d %d", &delay, &rate) != 2) {
- xf86Msg(X_ERROR, "\"%s\" is not a valid AutoRepeat value", s);
- } else {
- pKbd->delay = delay;
- pKbd->rate = rate;
- }
- xfree(s);
- }
-
if ((s = xf86SetStrOption(pInfo->options, "XLeds", NULL))) {
char *l, *end;
unsigned int i;
@@ -365,7 +354,6 @@ KbdCtrl( DeviceIntPtr device, KeybdCtrl *ctrl)
static void
InitKBD(InputInfoPtr pInfo, Bool init)
{
- char rad;
xEvent kevent;
KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 1
@@ -418,14 +406,6 @@ InitKBD(InputInfoPtr pInfo, Bool init)
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;
- else rad = 0x60;
- if (pKbd->rate <= 2) rad |= 0x1F;
- else if (pKbd->rate >= 30) rad |= 0x00;
- else rad |= ((58 / pKbd->rate) - 2);
- pKbd->SetKbdRepeat(pInfo, rad);
} else {
unsigned long leds = pKbd->keyLeds;
diff --git a/src/lnx_kbd.c b/src/lnx_kbd.c
index 46cc1e4..d599df7 100644
--- a/src/lnx_kbd.c
+++ b/src/lnx_kbd.c
@@ -95,151 +95,6 @@ GetKbdLeds(InputInfoPtr pInfo)
return(leds);
}
-static int
-KDKBDREP_ioctl_ok(int rate, int delay) {
-#if defined(KDKBDREP) && !defined(__sparc__)
- /* This ioctl is defined in <linux/kd.h> but is not
- implemented anywhere - must be in some m68k patches. */
- struct kbd_repeat kbdrep_s;
-
- /* don't change, just test */
- kbdrep_s.LNX_KBD_PERIOD_NAME = -1;
- kbdrep_s.delay = -1;
- if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) {
- return 0;
- }
-
- /* do the change */
- if (rate == 0) /* switch repeat off */
- kbdrep_s.LNX_KBD_PERIOD_NAME = 0;
- else
- kbdrep_s.LNX_KBD_PERIOD_NAME = 10000 / rate; /* convert cps to msec */
- if (kbdrep_s.LNX_KBD_PERIOD_NAME < 1)
- kbdrep_s.LNX_KBD_PERIOD_NAME = 1;
- kbdrep_s.delay = delay;
- if (kbdrep_s.delay < 1)
- kbdrep_s.delay = 1;
-
- if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) {
- return 0;
- }
-
- return 1; /* success! */
-#else /* no KDKBDREP */
- return 0;
-#endif /* KDKBDREP */
-}
-
-static int
-KIOCSRATE_ioctl_ok(int rate, int delay) {
-#ifdef KIOCSRATE
- struct kbd_rate kbdrate_s;
- int fd;
-
- fd = open("/dev/kbd", O_RDONLY);
- if (fd == -1)
- return 0;
-
- kbdrate_s.rate = (rate + 5) / 10; /* must be integer, so round up */
- kbdrate_s.delay = delay * HZ / 1000; /* convert ms to Hz */
- if (kbdrate_s.rate > 50)
- kbdrate_s.rate = 50;
-
- if (ioctl( fd, KIOCSRATE, &kbdrate_s )) {
- return 0;
- }
-
- close( fd );
-
- return 1;
-#else /* no KIOCSRATE */
- return 0;
-#endif /* KIOCSRATE */
-}
-
-#undef rate
-
-static void
-SetKbdRepeat(InputInfoPtr pInfo, char rad)
-{
- KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
- int i;
- int timeout;
- int value = 0x7f; /* Maximum delay with slowest rate */
-
-#ifdef __sparc__
- int rate = 500; /* Default rate */
- int delay = 200; /* Default delay */
-#else
- int rate = 300; /* Default rate */
- int delay = 250; /* Default delay */
-#endif
-
- static int valid_rates[] = { 300, 267, 240, 218, 200, 185, 171, 160, 150,
- 133, 120, 109, 100, 92, 86, 80, 75, 67,
- 60, 55, 50, 46, 43, 40, 37, 33, 30, 27,
- 25, 23, 21, 20 };
-#define RATE_COUNT (sizeof( valid_rates ) / sizeof( int ))
-
- static int valid_delays[] = { 250, 500, 750, 1000 };
-#define DELAY_COUNT (sizeof( valid_delays ) / sizeof( int ))
-
- if (pKbd->rate >= 0)
- rate = pKbd->rate * 10;
- if (pKbd->delay >= 0)
- delay = pKbd->delay;
-
- if(KDKBDREP_ioctl_ok(rate, delay)) /* m68k? */
- return;
-
- if(KIOCSRATE_ioctl_ok(rate, delay)) /* sparc? */
- return;
-
- if (xf86IsPc98())
- return;
-
-#if defined(__alpha__) || defined (__i386__) || defined(__ia64__)
-
- if (!xorgHWAccess) {
- if (xf86EnableIO())
- xorgHWAccess = TRUE;
- else
- return;
- }
-
- /* The ioport way */
-
- for (i = 0; i < RATE_COUNT; i++)
- if (rate >= valid_rates[i]) {
- value &= 0x60;
- value |= i;
- break;
- }
-
- for (i = 0; i < DELAY_COUNT; i++)
- if (delay <= valid_delays[i]) {
- value &= 0x1f;
- value |= i << 5;
- break;
- }
-
- timeout = KBC_TIMEOUT;
- while (((inb(0x64) & 2) == 2) && --timeout)
- usleep(1000); /* wait */
-
- if (timeout == 0)
- return;
-
- outb(0x60, 0xf3); /* set typematic rate */
- while (((inb(0x64) & 2) == 2) && --timeout)
- usleep(1000); /* wait */
-
- usleep(10000);
- outb(0x60, value);
-
-#endif /* __alpha__ || __i386__ || __ia64__ */
-}
-
typedef struct {
int kbdtrans;
struct termios kbdtty;
@@ -376,7 +231,6 @@ xf86OSKbdPreInit(InputInfoPtr pInfo)
pKbd->Bell = SoundBell;
pKbd->SetLeds = SetKbdLeds;
pKbd->GetLeds = GetKbdLeds;
- pKbd->SetKbdRepeat = SetKbdRepeat;
pKbd->KbdGetMapping = KbdGetMapping;
pKbd->RemapScanCode = NULL;
diff --git a/src/xf86OSKbd.h b/src/xf86OSKbd.h
index a73e3ad..2732649 100644
--- a/src/xf86OSKbd.h
+++ b/src/xf86OSKbd.h
@@ -67,8 +67,6 @@ typedef struct {
OpenKeyboardProc OpenKeyboard;
PostEventProc PostEvent;
- int rate;
- int delay;
int bell_pitch;
int bell_duration;
Bool autoRepeat;