From 5928ee64017cfcd2d3b5fd757c775df567822eef Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Fri, 8 Feb 2008 19:00:57 -0200 Subject: [PATCH] Alternate patch to preserve NumLock & CapsLock leds at X Server startup. This patch requires reverting commits: 7148a0c3e04668b7608295ebdf94579f6acfa544 and 0f3716db01681876cc385727beeb842af5b950d3 Also, it is assumed that the os specific GetLeds will properly use bit 0 for caps lock and bit 1 for num lock. --- src/kbd.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/kbd.c b/src/kbd.c index 68d29c2..dc9ea7a 100644 --- a/src/kbd.c +++ b/src/kbd.c @@ -470,9 +470,16 @@ InitKBD(InputInfoPtr pInfo, Bool init) pKbd->scanPrefix = 0; if (init) { - pKbd->keyLeds = 0; - + pKbd->keyLeds = pKbd->GetLeds(pInfo); UpdateLeds(pInfo); + if (pKbd->keyLeds & CAPSFLAG) { + pKbd->PostEvent(pInfo, KEY_CapsLock, TRUE); + pKbd->PostEvent(pInfo, KEY_CapsLock, FALSE); + } + if (pKbd->keyLeds & NUMFLAG) { + pKbd->PostEvent(pInfo, KEY_NumLock, TRUE); + pKbd->PostEvent(pInfo, KEY_NumLock, FALSE); + } if( pKbd->delay <= 375) rad = 0x00; else if (pKbd->delay <= 625) rad = 0x20; -- 1.5.3.5