[PATCH keyboard] Removing unused code ABI_XINPUT_VERSION < 1

Peter Hutterer peter.hutterer at who-t.net
Sun Jan 9 16:05:51 PST 2011


On Sat, Jan 08, 2011 at 08:25:23PM +0500, Alexandr Shadchin wrote:
> correct me if I'm wrong, but it is high time to remove

this needs bumping in configure.ac to require servers 1.4 and later.
though, tbh I wouldn't mind making the driver dependent on the latest server
version (like I did with a few other drivers). the driver doesn't see 
updates that require anyone to update it once released, so backwards
compatibility is a mostly unneded feature.

Cheers,
  Peter
 
> Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin at gmail.com>
> ---
>  src/kbd.c |   44 --------------------------------------------
>  1 files changed, 0 insertions(+), 44 deletions(-)
> 
> diff --git a/src/kbd.c b/src/kbd.c
> index b261b2b..df7b3e7 100644
> --- a/src/kbd.c
> +++ b/src/kbd.c
> @@ -297,51 +297,7 @@ KbdCtrl( DeviceIntPtr device, KeybdCtrl *ctrl)
>  static void
>  InitKBD(InputInfoPtr pInfo, Bool init)
>  {
> -  xEvent          kevent;
>    KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
> -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 1
> -  DeviceIntPtr    pKeyboard = pInfo->dev;
> -  KeyClassRec     *keyc = pKeyboard->key;
> -  KeySym          *map = keyc->curKeySyms.map;
> -  unsigned int    i;
> -#endif
> -
> -  kevent.u.keyButtonPointer.time = GetTimeInMillis();
> -  kevent.u.keyButtonPointer.rootX = 0;
> -  kevent.u.keyButtonPointer.rootY = 0;
> -
> -/* The server does this for us with i-h. */
> -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 1
> -  /*
> -   * Hmm... here is the biggest hack of every time !
> -   * It may be possible that a switch-vt procedure has finished BEFORE
> -   * you released all keys neccessary to do this. That peculiar behavior
> -   * can fool the X-server pretty much, cause it assumes that some keys
> -   * were not released. TWM may stuck alsmost completly....
> -   * OK, what we are doing here is after returning from the vt-switch
> -   * exeplicitely unrelease all keyboard keys before the input-devices
> -   * are reenabled.
> -   */
> -  for (i = keyc->curKeySyms.minKeyCode, map = keyc->curKeySyms.map;
> -       i < keyc->curKeySyms.maxKeyCode;
> -       i++, map += keyc->curKeySyms.mapWidth)
> -     if (KeyPressed(i))
> -      {
> -        switch (*map) {
> -        /* Don't release the lock keys */
> -        case XK_Caps_Lock:
> -        case XK_Shift_Lock:
> -        case XK_Num_Lock:
> -        case XK_Scroll_Lock:
> -        case XK_Kana_Lock:
> -          break;
> -        default:
> -          kevent.u.u.detail = i;
> -          kevent.u.u.type = KeyRelease;
> -          (* pKeyboard->public.processInputProc)(&kevent, pKeyboard, 1);
> -        }
> -      }
> -#endif
>  
>    pKbd->scanPrefix      = 0;
>  
> -- 
> 1.7.3.5
> 


More information about the xorg-devel mailing list