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 @
#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) |
|
||||||||||||
|
Set the LEDs. |
|
||||||||||||
|
Fill the info structure with information needed to initialize pDev. |
|
|
Initialize pDev using usbInit. |
|
|
Turn pDev on (i.e., take input from 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. |
#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] |
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 BLOCK DMXBlockType |
| #define CHECKPROC dmxCheckSpecialProcPtr |
| #define ENQUEUEPROC dmxEnqueueProcPtr |
| #define FATAL0 | ( | f | ) | dmxLog(dmxFatal,f) |
| #define FATAL1 | ( | f, | ||
| a | ||||
| ) | dmxLog(dmxFatal,f,a) |
| #define FATAL2 | ( | f, | a41 1a42 5 | a, | |||
| d44 2 a45 2 | b | d49 2 a50 2 | ) | dmxLog(dmxFatal,f,a,b) | a51 3
| #define GETPRIV |
| #define GLYPHS_PER_KEY 4 |
| #define LOG0 | ( | f | ) | dmxLog(dmxDebug,f) |
| #define LOG1 | ( | f, | a79 1a80 32 | a |
| ) | dmxLog(dmxDebug,f,a) |
| #define LOG2 | ( | f, | |||||
| a, | |||||||
| d82 2 a83 2 | b | d87 2 a88 2 | ) | dmxLog(dmxDebug,f,a,b) | a89 3
| #define LOG3 | ( | f, | |||||
| a, | |||||||
| b, | |||||||
| c | |||||||
| ) | dmxLog(dmxDebug,f,a,b,c) |
| #define MAX_KEYCODE (NUM_KEYCODES + MIN_KEYCODE - 1) |
| #define MIN_KEYCODE 8 | a118 5
Referenced by kbdLinuxConvert(), kbdLinuxGetMap(), kbdUSBConvert(), and kbdUSBGetMap().
a119 9| #define MOTIONPROC dmxMotionProcPtr |
| #define NUM_KEYCODES 248 | a147 5
Referenced by kbdLinuxGetMap(), and kbdUSBGetMap().
a148 9| #define USB_KEYBOARD_DEBUG 0 |
| static void kbdUSBConvert | ( | DevicePtr | pDev, | ||||
| unsigned int | scanCode, | ||||||
| int | value, | ENQUEUEPROC | enqueue, | a175 1a176 5 | CHECKPROC | checkspecial, | |
| d178 2 a179 2 | BLOCK | block | a182 25 | ) | [static] |
References kbdLinuxKeyDown(), kbdUSBKeyDown(), kbdUSBKeyState(), and MIN_KEYCODE.
Referenced by kbdUSBRead().
| void kbdUSBCtrl | ( | DevicePtr | pDev, | ||||
| d184 2 a185 2 | KeybdCtrl * | ctrl | a188 22 | ) |
Set the LEDs.
| void kbdUSBGetInfo | ( | DevicePtr | pDev, | ||||
| d190 2 a191 2 | DMXLocalInitInfoPtr | info | a194 30 | ) |
Fill the info structure with information needed to initialize pDev.
References _DMXLocalInitInfo::focusClass, _DMXLocalInitInfo::force, _DMXLocalInitInfo::kbdFeedbackClass, kbdUSBGetMap(), _DMXLocalInitInfo::keyboard, _DMXLocalInitInfo::keyClass, _DMXLocalInitInfo::keySyms, _DMXLocalInitInfo::modMap, and _DMXLocalInitInfo::names.
| static void kbdUSBGetMap | ( | DevicePtr | pDev, | ||||
| KeySymsPtr | pKeySyms, | ||||||
| d196 2 a197 2 | CARD8 * | pModMap | d201 2 a202 2 | ) | [static] |
a203 5
References map, MIN_KEYCODE, and NUM_KEYCODES.
a204 16Referenced by kbdUSBGetInfo().
| 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.
KeySym map[NUM_KEYCODES *GLYPHS_PER_KEY] [static] |
Referenced by kbdLinuxGetMap(), kbdLinuxReadKernelMapping(), and kbdUSBGetMap().