head 1.2; access; symbols netbsd-7-2-RELEASE:1.1.1.3 netbsd-7-1-2-RELEASE:1.1.1.3 netbsd-7-1-1-RELEASE:1.1.1.3 netbsd-7-1:1.1.1.3.0.14 netbsd-7-1-RELEASE:1.1.1.3 netbsd-7-1-RC2:1.1.1.3 netbsd-7-1-RC1:1.1.1.3 netbsd-7-0-2-RELEASE:1.1.1.3 netbsd-7-0-1-RELEASE:1.1.1.3 netbsd-7-0:1.1.1.3.0.12 netbsd-7-0-RELEASE:1.1.1.3 netbsd-7-0-RC3:1.1.1.3 netbsd-7-0-RC2:1.1.1.3 netbsd-7-0-RC1:1.1.1.3 netbsd-5-2-3-RELEASE:1.1.1.1 netbsd-5-1-5-RELEASE:1.1.1.1 netbsd-6-0-6-RELEASE:1.1.1.3 netbsd-6-1-5-RELEASE:1.1.1.3 netbsd-7:1.1.1.3.0.10 netbsd-7-base:1.1.1.3 netbsd-6-1-4-RELEASE:1.1.1.3 netbsd-6-0-5-RELEASE:1.1.1.3 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.3 riastradh-drm2:1.1.1.3.0.8 riastradh-drm2-base:1.1.1.3 netbsd-6-1-3-RELEASE:1.1.1.3 netbsd-6-0-4-RELEASE:1.1.1.3 netbsd-5-2-2-RELEASE:1.1.1.1 netbsd-5-1-4-RELEASE:1.1.1.1 netbsd-6-1-2-RELEASE:1.1.1.3 netbsd-6-0-3-RELEASE:1.1.1.3 netbsd-5-2-1-RELEASE:1.1.1.1 netbsd-5-1-3-RELEASE:1.1.1.1 netbsd-6-1-1-RELEASE:1.1.1.3 xorg-server-1-10-6:1.1.1.3 netbsd-6-1:1.1.1.3.0.6 netbsd-6-0-2-RELEASE:1.1.1.3 netbsd-6-1-RELEASE:1.1.1.3 netbsd-6-1-RC4:1.1.1.3 netbsd-6-1-RC3:1.1.1.3 netbsd-6-1-RC2:1.1.1.3 netbsd-6-1-RC1:1.1.1.3 netbsd-5-2:1.1.1.1.0.8 netbsd-6-0-1-RELEASE:1.1.1.3 netbsd-5-2-RELEASE:1.1.1.1 netbsd-5-2-RC1:1.1.1.1 netbsd-6-0:1.1.1.3.0.4 netbsd-6-0-RELEASE:1.1.1.3 netbsd-6-0-RC2:1.1.1.3 netbsd-6-0-RC1:1.1.1.3 netbsd-6:1.1.1.3.0.2 netbsd-6-base:1.1.1.3 netbsd-5-1-2-RELEASE:1.1.1.1 netbsd-5-1-1-RELEASE:1.1.1.1 xorg-server-1-10-3:1.1.1.3 mrg-xorg-server-1-9-5-pre-1-10-3:1.1.1.2 xorg-server-1-9-5:1.1.1.2 xorg-server-1-9-2:1.1.1.2 netbsd-5-1:1.1.1.1.0.6 netbsd-5-1-RELEASE:1.1.1.1 netbsd-5-1-RC4:1.1.1.1 netbsd-5-1-RC3:1.1.1.1 netbsd-5-1-RC2:1.1.1.1 netbsd-5-1-RC1:1.1.1.1 netbsd-5-0-2-RELEASE:1.1.1.1 xorg-server-1-6-5:1.1.1.1 xorg-server-1-6-3:1.1.1.1 netbsd-5-0-1-RELEASE:1.1.1.1 xorg-server-1-6-2:1.1.1.1 xorg-server-1-6-1-901:1.1.1.1 netbsd-5-0:1.1.1.1.0.4 netbsd-5-0-RELEASE:1.1.1.1 netbsd-5-0-RC4:1.1.1.1 netbsd-5-0-RC3:1.1.1.1 netbsd-5-0-RC2:1.1.1.1 netbsd-5-0-RC1:1.1.1.1 netbsd-5:1.1.1.1.0.2 netbsd-5-base:1.1.1.1 xorg-server-1-4-2:1.1.1.1 xorg:1.1.1; locks; strict; comment @# @; 1.2 date 2016.08.11.00.04.29; author mrg; state dead; branches; next 1.1; commitid FQxwnZNPy5ZgOOhz; 1.1 date 2008.07.31.19.50.32; author mrg; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2008.07.31.19.50.32; author mrg; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2010.11.23.05.21.25; author mrg; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2011.08.02.06.56.52; author mrg; state Exp; branches; next ; desc @@ 1.2 log @first merge of netbsd changes. not tested yet. @ text @ File Index
Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

usb-keyboard.c File Reference

#include "atKeynames.h"
#include "usb-private.h"
#include "usb-keyboard.h"

Functions

void kbdUSBCtrl (DevicePtr pDev, KeybdCtrl *ctrl)
void kbdUSBInit (DevicePtr pDev)
void kbdUSBRead (DevicePtr pDev, MOTIONPROC motion, ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
int kbdUSBOn (DevicePtr pDev)
void kbdUSBGetInfo (DevicePtr pDev, DMXLocalInitInfoPtr info)

Detailed Description

This code implements a low-level device driver for a USB keyboard under Linux. The keymap description is derived from code by Thomas Roell, Orest Zborowski.

Function Documentation

void kbdUSBCtrl DevicePtr  pDev,
KeybdCtrl *  ctrl
 

Set the LEDs.

void kbdUSBGetInfo DevicePtr  pDev,
DMXLocalInitInfoPtr  info
 

Fill the info structure with information needed to initialize pDev.

void kbdUSBInit DevicePtr  pDev  ) 
 

Initialize pDev using usbInit.

int kbdUSBOn DevicePtr  pDev  ) 
 

Turn pDev on (i.e., take input from pDev).

void kbdUSBRead DevicePtr  pDev,
MOTIONPROC  motion,
ENQUEUEPROC  enqueue,
CHECKPROC  checkspecial,
BLOCK  block
 

Read an event from the pDev device. If the event is a motion event, enqueue it with the motion function. Otherwise, check for special keys with the checkspecial function and enqueue the event with the enqueue function. The block type is passed to the functions so that they may block SIGIO handling as appropriate to the caller of this function.


Generated June 29, 2004 for Distributed Multihead X by doxygen 1.3.4. @ 1.1 log @Initial revision @ text @@ 1.1.1.1 log @initial import of xorg-server-1.4.2 @ text @@ 1.1.1.2 log @import xorg-server 1.9.2. important changes since 1.6.5 include: - built-in symbol visibility, default not export - fixes for various crashes - many fixes for XI2, EXA, dix, render, glx, xkb, EDID, randr, Xv, resource handling, Xext, vfb, xfree86 / vga and composite support. - fixes several memory leaks - many many documentation updates - record extension enabled - no longer looks for XF86Config files @ text @d9 9 a17 77

usb-keyboard.c File Reference

#include "atKeynames.h"
#include "usb-private.h"
#include "usb-keyboard.h"
#include <xkbsrv.h>

Defines

#define USB_KEYBOARD_DEBUG   0
#define GETPRIV
#define LOG0(f)   dmxLog(dmxDebug,f)
#define LOG1(f, a)   dmxLog(dmxDebug,f,a)
#define LOG2(f, a, b)   dmxLog(dmxDebug,f,a,b)
#define LOG3(f, a, b, c)   dmxLog(dmxDebug,f,a,b,c)
#define FATAL0(f)   dmxLog(dmxFatal,f)
#define FATAL1(f, a)   dmxLog(dmxFatal,f,a)
#define FATAL2(f, a, b)   dmxLog(dmxFatal,f,a,b)
#define MOTIONPROC   dmxMotionProcPtr
#define ENQUEUEPROC   dmxEnqueueProcPtr
#define CHECKPROC   dmxCheckSpecialProcPtr
#define BLOCK   DMXBlockType
#define GLYPHS_PER_KEY   4
#define NUM_KEYCODES   248
#define MIN_KEYCODE   8
#define MAX_KEYCODE   (NUM_KEYCODES + MIN_KEYCODE - 1)

Functions

static int kbdUSBKeyDown (myPrivate *priv, int keyCode)
static void kbdUSBKeyState (myPrivate *priv, int type, int keyCode)
void kbdUSBCtrl (DevicePtr pDev, KeybdCtrl *ctrl)
void kbdUSBInit (DevicePtr pDev)
static void kbdUSBConvert (DevicePtr pDev, unsigned int scanCode, int value, ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
void kbdUSBRead (DevicePtr pDev, MOTIONPROC motion, ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
int kbdUSBOn (DevicePtr pDev)
static void kbdUSBGetMap (DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
void kbdUSBGetInfo (DevicePtr pDev, DMXLocalInitInfoPtr info)

Variables

static KeySym map [NUM_KEYCODES *GLYPHS_PER_KEY]

Detailed Description

This code implements a low-level device driver for a USB keyboard under Linux. The keymap description is derived from code by Thomas Roell, Orest Zborowski.


Define Documentation

#define BLOCK   DMXBlockType
d19 1 a19 12
#define CHECKPROC   dmxCheckSpecialProcPtr
d21 1 a21 12
#define ENQUEUEPROC   dmxEnqueueProcPtr
d23 1 a23 17
#define FATAL0 (   f  )     dmxLog(dmxFatal,f)
d25 1 a25 26
#define FATAL1 (   f,
  a 
)    dmxLog(dmxFatal,f,a)
d27 8 a34 6
d36 4 a39 4 a41 1 a42 5 d44 2 a45 2 d49 2 a50 2 a51 3
#define FATAL2 (   f,   a,
  b )    dmxLog(dmxFatal,f,a,b)
a52 9
d54 19 a72 42
Value:
myPrivate *priv                            \
                      = ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private
#define GETPRIV
#define GLYPHS_PER_KEY   4
#define LOG0 (   f  )     dmxLog(dmxDebug,f)
d74 4 a77 4 a79 1 a80 32
#define LOG1 (   f,   a 
)    dmxLog(dmxDebug,f,a)
d82 2 a83 2 d87 2 a88 2 a89 3
#define LOG2 (   f,
  a,
  b )    dmxLog(dmxDebug,f,a,b)
a90 35
d92 26 a117 26

Referenced by kbdUSBRead().

#define LOG3 (   f,
  a,
  b,
  c 
)    dmxLog(dmxDebug,f,a,b,c)
#define MAX_KEYCODE   (NUM_KEYCODES + MIN_KEYCODE - 1)
a118 5
#define MIN_KEYCODE   8
d121 26 a146 11
#define MOTIONPROC   dmxMotionProcPtr
a147 5
#define NUM_KEYCODES   248

Referenced by kbdLinuxGetMap(), and kbdUSBGetMap().

a148 9
d150 19 a168 28

Function Documentation

#define USB_KEYBOARD_DEBUG   0
d170 4 a173 4 a175 1 a176 5 d178 2 a179 2 a182 25
static void kbdUSBConvert ( DevicePtr  pDev,
unsigned int  scanCode,
int  value,
ENQUEUEPROC  enqueue, CHECKPROC  checkspecial,
BLOCK  block ) [static]
d184 2 a185 2 a188 22
void kbdUSBCtrl ( DevicePtr  pDev,
KeybdCtrl *  ctrl )

Set the LEDs.

d190 2 a191 2 a194 30
void kbdUSBGetInfo ( DevicePtr  pDev,
DMXLocalInitInfoPtr  info )
d196 2 a197 2 d201 2 a202 2 a203 5
static void kbdUSBGetMap ( DevicePtr  pDev,
KeySymsPtr  pKeySyms,
CARD8 *  pModMap ) [static]

References map, MIN_KEYCODE, and NUM_KEYCODES.

a204 16

Referenced by kbdUSBGetInfo().

d206 14 a219 164

Initialize pDev using usbInit.

References usbInit(), and usbKeyboard.

Referenced by kbdUSBOn().

void kbdUSBInit ( DevicePtr  pDev  ) 
static int kbdUSBKeyDown ( myPrivate priv,
int  keyCode 
) [static]

References _myPrivate::kbdState, and NUM_STATE_ENTRIES.

Referenced by kbdUSBConvert().

static void kbdUSBKeyState ( myPrivate priv,
int  type,
int  keyCode 
) [static]

References _myPrivate::kbdState, and NUM_STATE_ENTRIES.

Referenced by kbdUSBConvert().

int kbdUSBOn ( DevicePtr  pDev  ) 

Turn pDev on (i.e., take input from pDev).

References kbdUSBInit().

void kbdUSBRead ( DevicePtr  pDev,
MOTIONPROC  motion,
ENQUEUEPROC  enqueue,
CHECKPROC  checkspecial,
BLOCK  block 
)

Read an event from the pDev device. If the event is a motion event, enqueue it with the motion function. Otherwise, check for special keys with the checkspecial function and enqueue the event with the enqueue function. The block type is passed to the functions so that they may block SIGIO handling as appropriate to the caller of this function.

References kbdUSBConvert(), and LOG3.


Variable Documentation

KeySym map[NUM_KEYCODES *GLYPHS_PER_KEY] [static]
@ 1.1.1.3 log @initial import of xorg-server 1.10.3. highlights include: - fixes xorg bugs 29969, 30367, 30527, 30267, 30260, 29046, 30260, 31548, 28672, 24887, 32115, 21457, 32436, 21827, 28414, 24703, 32803, 16318, 33449, 33324, 33929, 35082, 35209, 36146, 36119 - many additional NULL checks - adjustments related to input ABI 12 - *lots* of dead code removal - vga arbitrator fixes - GL fixes - EDID fixes - conversion to using asprintf() in many places - many fixes from valgrind, compiler warnings see these for more details: http://lists.freedesktop.org/archives/xorg-announce/2011-February/001612.html http://lists.freedesktop.org/archives/xorg-announce/2011-April/001646.html http://lists.freedesktop.org/archives/xorg-announce/2011-May/001675.html http://lists.freedesktop.org/archives/xorg-announce/2011-July/001710.html @ text @d9 3 a11 2