From 1f876171067c04fc21fccd5a3051f982fd85c0f0 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 21 Oct 2009 19:07:36 +0000 Subject: Updated to xorg-server-1.7.99.1 --- xorg-server/hw/dmx/doc/html/lnx-keyboard_8c.html | 1483 ++++++++++++++++------ 1 file changed, 1115 insertions(+), 368 deletions(-) (limited to 'xorg-server/hw/dmx/doc/html/lnx-keyboard_8c.html') diff --git a/xorg-server/hw/dmx/doc/html/lnx-keyboard_8c.html b/xorg-server/hw/dmx/doc/html/lnx-keyboard_8c.html index e02182b73..05de129c4 100644 --- a/xorg-server/hw/dmx/doc/html/lnx-keyboard_8c.html +++ b/xorg-server/hw/dmx/doc/html/lnx-keyboard_8c.html @@ -6,497 +6,1244 @@ - -
Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals
-

lnx-keyboard.c File Reference

#include "dmxinputinit.h"
-#include "lnx-keyboard.h"
-#include "inputstr.h"
-#include "Xos.h"
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <signal.h>
-#include <sys/vt.h>
-#include <sys/kd.h>
-#include <termios.h>
-#include "atKeynames.h"
-#include "xf86Keymap.h"
-#include <linux/keyboard.h>
- - - - + + +
+

lnx-keyboard.c File Reference

#include "dmxinputinit.h"
+#include "lnx-keyboard.h"
+#include "inputstr.h"
+#include <X11/Xos.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <signal.h>
+#include <sys/vt.h>
+#include <sys/kd.h>
+#include <termios.h>
+#include "atKeynames.h"
+#include <linux/keyboard.h>
+#include <xkbsrv.h>
+

Data Structures

struct  _myPrivate
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Data Structures

struct  _myPrivate

Defines

#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 SWITCHRETPROC   dmxVTSwitchReturnProcPtr
#define BLOCK   DMXBlockType
#define MESSAGE   "\033c\n\n\nDMX taking input from this console..."
#define FINALMESSAGE   "\033cDMX terminated."
#define NUM_AT2LNX   (sizeof(at2lnx) / sizeof(at2lnx[0]))
#define NUM_STATE_ENTRIES   (256/32)
#define SYSCALL(call)   while(((call) == -1) && (errno == EINTR))

Typedefs

typedef struct _myPrivate myPrivate

Functions

static int kbdLinuxKeyDown (myPrivate *priv, int keyCode)
static void kbdLinuxKeyState (myPrivate *priv, int type, int keyCode)
pointer kbdLinuxCreatePrivate (DeviceIntPtr pKeyboard)
void kbdLinuxDestroyPrivate (pointer priv)
void kbdLinuxBell (DevicePtr pDev, int percent, int volume, int pitch, int duration)
void kbdLinuxCtrl (DevicePtr pDev, KeybdCtrl *ctrl)
static int kbdLinuxGetFreeVTNumber (void)
static int kbdLinuxOpenVT (int vtno)
static int kbdLinuxGetCurrentVTNumber (int fd)
static int kbdLinuxActivate (int fd, int vtno, int setSig)
void kbdLinuxVTPreSwitch (pointer p)
void kbdLinuxVTPostSwitch (pointer p)
int kbdLinuxVTSwitch (pointer p, int vt, void(*switch_return)(pointer), pointer switch_return_data)
static void kbdLinuxVTSignalHandler (int sig)
static void kbdLinuxOpenConsole (DevicePtr pDev)
static void kbdLinuxCloseConsole (DevicePtr pDev)
void kbdLinuxInit (DevicePtr pDev)
static int kbdLinuxPrefix0Mapping (unsigned char *scanCode)
static int kbdLinuxPrefixMapping (myPrivate *priv, unsigned char *scanCode)
static void kbdLinuxConvert (DevicePtr pDev, unsigned char scanCode, ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
void kbdLinuxRead (DevicePtr pDev, MOTIONPROC motion, ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
int kbdLinuxOn (DevicePtr pDev)
void kbdLinuxOff (DevicePtr pDev)
static void kbdLinuxReadKernelMapping (int fd, KeySymsPtr pKeySyms)
static void kbdLinuxGetMap (DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
void kbdLinuxGetInfo (DevicePtr pDev, DMXLocalInitInfoPtr info)

Variables

static myPrivatePRIV = NULL
static KeySym linux_to_x [256]
static unsigned char at2lnx [NUM_KEYCODES]
+

Detailed Description

+

This code implements a low-level device driver for the Linux keyboard. The code is derived from code by Thomas Roell, Orest Zborowski, and David Dawes (see the source code for complete references).

+

Define Documentation

+ +
+
+ + + + +
#define BLOCK   DMXBlockType
+
+
-

Functions

-pointer kbdLinuxCreatePrivate (DeviceIntPtr pKeyboard) +
+
+ +
+
+ + + + +
#define CHECKPROC   dmxCheckSpecialProcPtr
+
+
-void kbdLinuxDestroyPrivate (pointer priv) +
+
+ +
+
+ + + + +
#define ENQUEUEPROC   dmxEnqueueProcPtr
+
+
-void kbdLinuxBell (DevicePtr pDev, int percent, int volume, int pitch, int duration) +
+
+ +
+
+ + + + + + + + + +
#define FATAL0( )    dmxLog(dmxFatal,f)
+
+
-void kbdLinuxCtrl (DevicePtr pDev, KeybdCtrl *ctrl) +

Referenced by kbdLinuxActivate(), kbdLinuxGetFreeVTNumber(), and kbdLinuxVTSwitch().

-void kbdLinuxVTPreSwitch (pointer p) +
+
+ +
+
+ + + + + + + + + + + + + + +
#define FATAL1(f,
 )    dmxLog(dmxFatal,f,a)
+
+
-void kbdLinuxVTPostSwitch (pointer p) +

Referenced by kbdLinuxGetFreeVTNumber(), kbdLinuxInit(), kbdLinuxOn(), msLinuxInit(), msLinuxOn(), ps2LinuxInit(), and usbInit().

-int kbdLinuxVTSwitch (pointer p, int vt, void(*switch_return)(pointer), pointer switch_return_data) +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
#define FATAL2(f,
a,
 )    dmxLog(dmxFatal,f,a,b)
+
+
-void kbdLinuxInit (DevicePtr pDev) +

Referenced by kbdLinuxOpenVT().

-void kbdLinuxRead (DevicePtr pDev, MOTIONPROC motion, ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block) +
+
+ +
+
+ + + + +
#define FINALMESSAGE   "\033cDMX terminated."
+
+
-int kbdLinuxOn (DevicePtr pDev) +

Referenced by kbdLinuxCloseConsole().

-void kbdLinuxOff (DevicePtr pDev) +
+
+ +
+
+ + + + +
#define GETPRIV
+
+ +
+ +
+
+ + + + + + + + + +
#define LOG0( )    dmxLog(dmxDebug,f)
+
+
- -

Detailed Description

-This code implements a low-level device driver for the Linux keyboard. The code is derived from code by Thomas Roell, Orest Zborowski, and David Dawes (see the source code for complete references).

Function Documentation

-

- - - - -
- + + + +
+
+
- - - - + + + + - - - + + + + + +
void kbdLinuxBell DevicePtr  pDev, #define LOG1(f,
int  percent,  )    dmxLog(dmxDebug,f,a)
+ +
+ +

Referenced by kbdLinuxCloseConsole().

+ +
+ + +
+
+ + + + + + - - - + + - - - + + + + +
#define LOG2(f,
int  volume, a,
int  pitch,  )    dmxLog(dmxDebug,f,a,b)
+
+ +
+ +
+
+ + + + + + + + + + + - - + + - - + + + + +
#define LOG3(f,
a,
int  durationb,
 )    dmxLog(dmxDebug,f,a,b,c)
+
+
+

Referenced by kbdUSBRead(), and usbRead().

+ +
+
+ +
+
+ + + +
#define MESSAGE   "\033c\n\n\nDMX taking input from this console..."
-
- - - - - -
-   - - -

-Ring the bell.

-Note: we completely ignore the volume, since Linux's ioctl() interface does not provide a way to control it. If it did, the XBell manpage tells how the actual volume is a function of the percent and the (base) volume.

-Note that most of the other PC-based bell drivers compute the duration for KDMKTONE as a function of the volume and the duration. For some drivers, the duration is only measured in mS if the volume is 50, and is scaled by the volume for other values. This seems confusing and possibly incorrect (the xset man page says that the bell will be "as closely as it can to the user's specifications" -- if we ignore the volume and set the duration correctly, then we'll get one parameter "wrong" -- but if we use the volume to scale the duration, then we'll get both parameters "wrong").

-

- - - - -
- + +
+ +

Referenced by kbdLinuxOpenConsole().

+ +
+ + +
+
+
- - - - - - + +
pointer kbdLinuxCreatePrivate DeviceIntPtr  pKeyboard  ) #define MOTIONPROC   dmxMotionProcPtr
+ +
+
+ + +
+
+ + + +
#define NUM_AT2LNX   (sizeof(at2lnx) / sizeof(at2lnx[0]))
-
- - - - - -
-   - - -

-Create a private structure for use within this file.

-

- - - - -
- + +
+ +

Referenced by kbdLinuxReadKernelMapping().

+ +
+ + +
+
+
+ + + +
#define NUM_STATE_ENTRIES   (256/32)
+ + + + +
+
+ + + + +
#define SWITCHRETPROC   dmxVTSwitchReturnProcPtr
+
+
+ +
+
+ +
+
+ + + + + + + + + +
#define SYSCALL(call  )    while(((call) == -1) && (errno == EINTR))
+
+
+ +

Referenced by kbdLinuxActivate().

+ +
+
+

Typedef Documentation

+ +
+
+ - - - - + +
void kbdLinuxCtrl DevicePtr  pDev, typedef struct _myPrivate myPrivate
+
+
+ +
+
+

Function Documentation

+ +
+
+ + + + + + + + + + + + + - - + + - - + + -
static int kbdLinuxActivate (int  fd,
int  vtno,
KeybdCtrl *  ctrlint  setSig 
) [static]
-
- - - - - -
-   - - -

-Set the LEDs.

-

- - - - -
- + + + + +
+
+
+ + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + +
void kbdLinuxBell (DevicePtr  pDev,
int  percent,
int  volume,
void kbdLinuxDestroyPrivate pointer  priv  ) int  pitch,
int  duration 
)
+ +
+

Ring the bell.

+

Note: we completely ignore the volume, since Linux's ioctl() interface does not provide a way to control it. If it did, the XBell manpage tells how the actual volume is a function of the percent and the (base) volume.

+

Note that most of the other PC-based bell drivers compute the duration for KDMKTONE as a function of the volume and the duration. For some drivers, the duration is only measured in mS if the volume is 50, and is scaled by the volume for other values. This seems confusing and possibly incorrect (the xset man page says that the bell will be "as closely as it can to the user's specifications" -- if we ignore the volume and set the duration correctly, then we'll get one parameter "wrong" -- but if we use the volume to scale the duration, then we'll get both parameters "wrong").

+ +

References GETPRIV.

+
+ + +
+
+ + + + + + + + +
static void kbdLinuxCloseConsole (DevicePtr  pDev )  [static]
-
- - - - - -
-   - - -

-Destroy a private structure.

-

- - - - -
- + +
+ +

References FINALMESSAGE, GETPRIV, kbdLinuxActivate(), and LOG1.

+ +

Referenced by kbdLinuxOff().

+ +
+ + +
+
+
- - - - + + + + + + + + + + - - + + + - - + + + + + + + + + + + + + -
void kbdLinuxGetInfo DevicePtr  pDev, static void kbdLinuxConvert (DevicePtr  pDev,
unsigned char  scanCode,
DMXLocalInitInfoPtr  infoENQUEUEPROC  enqueue,
CHECKPROC  checkspecial,
BLOCK  block 
) [static]
-
- - - - - -
-   - - -

-Fill the info structure with information needed to initialize pDev.

-

- - - - -
- + + + + +
+
+
- - - - - - + + + + + + +
void kbdLinuxInit DevicePtr  pDev  ) pointer kbdLinuxCreatePrivate (DeviceIntPtr  pKeyboard ) 
+ +
+

Create a private structure for use within this file.

+ +

References _myPrivate::fd, and _myPrivate::pKeyboard.

+
+ + +
+
+ + + + + + + + + + + + + + + + + +
void kbdLinuxCtrl (DevicePtr  pDev,
KeybdCtrl *  ctrl 
)
-
- - - - - -
-   - - -

-Initialize the pDev as a Linux keyboard.

-

- - - - -
- + +
+

Set the LEDs.

+ +

References GETPRIV.

+ +
+ + +
+
+
- - - - - - + + + + + + +
void kbdLinuxOff DevicePtr  pDev  ) void kbdLinuxDestroyPrivate (pointer  priv ) 
+ +
+

Destroy a private structure.

+
+ + +
+
+ + + + + + + + +
static int kbdLinuxGetCurrentVTNumber (int  fd )  [static]
-
- - - - - -
-   - - -

-Turn pDev off (i.e., stop taking input from pDev).

-

- - - - -
- + +
+ +

Referenced by kbdLinuxOpenConsole().

+ +
+ + +
+
+
- - - - - - + + + + + + +
int kbdLinuxOn DevicePtr  pDev  ) static int kbdLinuxGetFreeVTNumber (void  )  [static]
+ +
+ +

References FATAL0, and FATAL1.

+ +

Referenced by kbdLinuxOpenConsole().

+
+ + +
+
+ + + + + + + + + + + + + + + + + +
void kbdLinuxGetInfo (DevicePtr  pDev,
DMXLocalInitInfoPtr  info 
)
-
- - - - - -
-   - - -

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

-

- - - - -
- + + + + +
+
+
- - - - + + + + + + + + + + - - + + + + + +
void kbdLinuxRead DevicePtr  pDev, static void kbdLinuxGetMap (DevicePtr  pDev,
KeySymsPtr  pKeySyms,
MOTIONPROC  motion, CARD8 *  pModMap 
) [static]
+ + + + +
+
+ + + + + + + - - +
void kbdLinuxInit (DevicePtr  pDev )  ENQUEUEPROC  enqueue,
+
+
+

Initialize the pDev as a Linux keyboard.

+ +

References FATAL1, GETPRIV, and kbdLinuxOpenConsole().

+ +
+
+ +
+
+ + + + + + + + + + + + - - + + + +
static int kbdLinuxKeyDown (myPrivate priv,
int  keyCode 
CHECKPROC  checkspecial, ) [static]
+
+
+ +

References _myPrivate::kbdState, and NUM_STATE_ENTRIES.

+ +

Referenced by kbdLinuxConvert(), and kbdUSBConvert().

+ +
+
+ +
+
+ + + + + + + + + + + + - - + + - - + + +
static void kbdLinuxKeyState (myPrivate priv,
int  type,
BLOCK  blockint  keyCode 
) [static]
+
+
+ +

References _myPrivate::kbdState, and NUM_STATE_ENTRIES.

+

Referenced by kbdLinuxConvert().

+ +
+
+ +
+
+ + + + + + + + +
void kbdLinuxOff (DevicePtr  pDev ) 
-
- - - - - -
-   - - -

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

-

- - - - -
- + +
+

Turn pDev off (i.e., stop taking input from pDev).

+ +

References GETPRIV, and kbdLinuxCloseConsole().

+ +
+ + +
+
+
- - - - - - + + + + + + +
void kbdLinuxVTPostSwitch pointer  p  ) int kbdLinuxOn (DevicePtr  pDev ) 
+ +
+

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

+ +

References FATAL1, and GETPRIV.

+
+ + +
+
+ + + + + + + + +
static void kbdLinuxOpenConsole (DevicePtr  pDev )  [static]
-
- - - - - -
-   - - -

-Currently unused hook called after returning from a VT switch.

-

- - - - -
- + + + + +
+
+
- - - - - - + + + + + + +
void kbdLinuxVTPreSwitch pointer  p  ) static int kbdLinuxOpenVT (int  vtno )  [static]
+ +
+ +

References FATAL2, and O_NONBLOCK.

+ +

Referenced by kbdLinuxOpenConsole().

+
+ + +
+
+ + + + + + + + +
static int kbdLinuxPrefix0Mapping (unsigned char *  scanCode )  [static]
-
- - - - - -
-   - - -

-Currently unused hook called prior to an VT switch.

-

- - - - -
- + +
+ +

Referenced by kbdLinuxPrefixMapping().

+ +
+ + +
+
+
- - - - + + + + + + + + + - - + + + +
int kbdLinuxVTSwitch pointer  p, static int kbdLinuxPrefixMapping (myPrivate priv,
unsigned char *  scanCode 
int  vt, ) [static]
+ +
+ +

References kbdLinuxPrefix0Mapping(), and _myPrivate::prefix.

+ +

Referenced by kbdLinuxConvert().

+ +
+ + +
+
+ + + + + + + + + + + + - - + + + + + + + + - - + + - - + + +
void kbdLinuxRead (DevicePtr  pDev,
MOTIONPROC  motion,
void(*  switch_return)(pointer), ENQUEUEPROC  enqueue,
CHECKPROC  checkspecial,
pointer  switch_return_dataBLOCK  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, and kbdLinuxConvert().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + +
static void kbdLinuxReadKernelMapping (int  fd,
KeySymsPtr  pKeySyms 
) [static]
-
- - - - - -
-   - - -

-Tell the operating system to switch to vt. The switch_return function is called with the switch_return_data when the VT is switched back to the pre-switch VT (i.e., the user returns to the DMX session).

+

+
+ +

References at2lnx, GLYPHS_PER_KEY, linux_to_x, map, and NUM_AT2LNX.

+ +

Referenced by kbdLinuxGetMap().

+ +
+
+ +
+
+ + + + + + + + + +
void kbdLinuxVTPostSwitch (pointer  p ) 
+
+
+

Currently unused hook called after returning from a VT switch.

+ +
+
+ +
+
+ + + + + + + + + +
void kbdLinuxVTPreSwitch (pointer  p ) 
+
+
+

Currently unused hook called prior to an VT switch.

+ +
+
+ +
+
+ + + + + + + + + +
static void kbdLinuxVTSignalHandler (int  sig )  [static]
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
int kbdLinuxVTSwitch (pointer  p,
int  vt,
void(*)(pointer)  switch_return,
pointer  switch_return_data 
)
+
+
+

Tell the operating system to switch to vt. The switch_return function is called with the switch_return_data when the VT is switched back to the pre-switch VT (i.e., the user returns to the DMX session).

+ +

References FATAL0, _myPrivate::fd, kbdLinuxActivate(), _myPrivate::switch_return, _myPrivate::switch_return_data, _myPrivate::switched, and _myPrivate::vtno.

+ +
+
+

Variable Documentation

+ +
+
+ + + + +
unsigned char at2lnx[NUM_KEYCODES] [static]
+
+
+ +

Referenced by kbdLinuxReadKernelMapping().

+ +
+
+ +
+
+ + + + +
KeySym linux_to_x[256] [static]
+
+
+ +

Referenced by kbdLinuxReadKernelMapping().

+ +
+
+ +
+
+ + + + +
myPrivate* PRIV = NULL [static]
+
+
+ +
+
+
-- cgit v1.2.3