Distributed Multihead X  1.16.4
usb-keyboard.c File Reference
#include "atKeynames.h"
#include "usb-private.h"
#include "usb-keyboard.h"
#include <xkbsrv.h>

Macros

#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.

Macro Definition Documentation

#define BLOCK   DMXBlockType
#define CHECKPROC   dmxCheckSpecialProcPtr
#define ENQUEUEPROC   dmxEnqueueProcPtr
#define FATAL0 (   f)    dmxLog(dmxFatal,f)
#define FATAL1 (   f,
 
)    dmxLog(dmxFatal,f,a)
#define FATAL2 (   f,
  a,
 
)    dmxLog(dmxFatal,f,a,b)
#define GETPRIV
Value:
myPrivate *priv \
= ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private
struct _DMXLocalInputInfo * DMXLocalInputInfoPtr
Definition: dmxinput.h:70
Definition: dmxbackend.c:64

Referenced by kbdUSBConvert(), kbdUSBCtrl(), kbdUSBOn(), and kbdUSBRead().

#define GLYPHS_PER_KEY   4
#define LOG0 (   f)    dmxLog(dmxDebug,f)
#define LOG1 (   f,
 
)    dmxLog(dmxDebug,f,a)
#define LOG2 (   f,
  a,
 
)    dmxLog(dmxDebug,f,a,b)
#define LOG3 (   f,
  a,
  b,
 
)    dmxLog(dmxDebug,f,a,b,c)

Referenced by kbdUSBRead().

#define MAX_KEYCODE   (NUM_KEYCODES + MIN_KEYCODE - 1)

Referenced by kbdLinuxGetMap(), and kbdUSBGetMap().

#define MIN_KEYCODE   8
#define MOTIONPROC   dmxMotionProcPtr
#define NUM_KEYCODES   248

Referenced by kbdLinuxGetMap(), and kbdUSBGetMap().

#define USB_KEYBOARD_DEBUG   0

Function Documentation

static void kbdUSBConvert ( DevicePtr  pDev,
unsigned int  scanCode,
int  value,
ENQUEUEPROC  enqueue,
CHECKPROC  checkspecial,
BLOCK  block 
)
static
void kbdUSBCtrl ( DevicePtr  pDev,
KeybdCtrl *  ctrl 
)

Set the LEDs.

References GETPRIV.

static void kbdUSBGetMap ( DevicePtr  pDev,
KeySymsPtr  pKeySyms,
CARD8 *  pModMap 
)
static
void kbdUSBInit ( DevicePtr  pDev)

Initialize pDev using usbInit.

References usbInit(), and usbKeyboard.

Referenced by kbdUSBOn().

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 GETPRIV, and 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 GETPRIV, kbdUSBConvert(), and LOG3.

Variable Documentation


Generated on Tue Aug 18 2015 01:27:31 for Distributed Multihead X by doxygen 1.8.8