cosmetic changes only
This commit is contained in:
@@ -51,8 +51,7 @@ static RageKeySym XSymToKeySym( int key )
|
||||
|
||||
switch( key )
|
||||
{
|
||||
/* These are needed because of the way X registers
|
||||
the keypad. */
|
||||
/* These are needed because of the way X registers the keypad. */
|
||||
case XK_KP_Insert: return KEY_KP_C0;
|
||||
case XK_KP_End: return KEY_KP_C1;
|
||||
case XK_KP_Down: return KEY_KP_C2;
|
||||
@@ -116,7 +115,7 @@ static RageKeySym XSymToKeySym( int key )
|
||||
}
|
||||
|
||||
/* 0...31: */
|
||||
if( key - 0xFF00 < 0x20)
|
||||
if( key - 0xFF00 < 0x20 )
|
||||
return ASCIIKeySyms[key - 0xFF00];
|
||||
|
||||
return KEY_INVALID;
|
||||
@@ -126,17 +125,19 @@ InputHandler_X11::InputHandler_X11()
|
||||
{
|
||||
XKeyboardControl state;
|
||||
state.auto_repeat_mode = AutoRepeatModeOff;
|
||||
XChangeKeyboardControl(X11Helper::Dpy,KBAutoRepeatMode,&state);
|
||||
XChangeKeyboardControl( X11Helper::Dpy, KBAutoRepeatMode, &state );
|
||||
X11Helper::Go();
|
||||
X11Helper::OpenMask(KeyPressMask); X11Helper::OpenMask(KeyReleaseMask);
|
||||
X11Helper::OpenMask( KeyPressMask );
|
||||
X11Helper::OpenMask( KeyReleaseMask );
|
||||
}
|
||||
|
||||
InputHandler_X11::~InputHandler_X11()
|
||||
{
|
||||
XKeyboardControl state;
|
||||
state.auto_repeat_mode = AutoRepeatModeDefault;
|
||||
XChangeKeyboardControl(X11Helper::Dpy,KBAutoRepeatMode,&state);
|
||||
X11Helper::CloseMask(KeyPressMask); X11Helper::CloseMask(KeyReleaseMask);
|
||||
XChangeKeyboardControl( X11Helper::Dpy, KBAutoRepeatMode, &state );
|
||||
X11Helper::CloseMask( KeyPressMask );
|
||||
X11Helper::CloseMask( KeyReleaseMask );
|
||||
X11Helper::Stop();
|
||||
}
|
||||
|
||||
@@ -144,35 +145,32 @@ void InputHandler_X11::Update()
|
||||
{
|
||||
XEvent event;
|
||||
|
||||
if (X11Helper::Win)
|
||||
while(XCheckTypedWindowEvent(X11Helper::Dpy,
|
||||
X11Helper::Win, KeyPress, &event) )
|
||||
if( X11Helper::Win )
|
||||
{
|
||||
LOG->Trace("key: sym %i, key %i, state true",
|
||||
XLookupKeysym(&event.xkey,0), XSymToKeySym(XLookupKeysym(&event.xkey,0)));
|
||||
while( XCheckTypedWindowEvent(X11Helper::Dpy, X11Helper::Win, KeyPress, &event) )
|
||||
{
|
||||
LOG->Trace( "key: sym %i, key %i, state true",
|
||||
XLookupKeysym(&event.xkey,0), XSymToKeySym(XLookupKeysym(&event.xkey,0)) );
|
||||
|
||||
DeviceInput di( DEVICE_KEYBOARD,
|
||||
XSymToKeySym(XLookupKeysym(&event.xkey,0)) );
|
||||
DeviceInput di( DEVICE_KEYBOARD, XSymToKeySym(XLookupKeysym(&event.xkey,0)) );
|
||||
ButtonPressed(di, true);
|
||||
}
|
||||
while(XCheckTypedWindowEvent(X11Helper::Dpy,
|
||||
X11Helper::Win, KeyRelease, &event) )
|
||||
|
||||
while( XCheckTypedWindowEvent(X11Helper::Dpy, X11Helper::Win, KeyRelease, &event) )
|
||||
{
|
||||
LOG->Trace("key: sym %i, key %i, state false",
|
||||
XLookupKeysym(&event.xkey,0), XSymToKeySym(XLookupKeysym(&event.xkey,0)));
|
||||
|
||||
DeviceInput di( DEVICE_KEYBOARD,
|
||||
XSymToKeySym(XLookupKeysym(&event.xkey,0)) );
|
||||
ButtonPressed(di, false);
|
||||
LOG->Trace( "key: sym %i, key %i, state false",
|
||||
XLookupKeysym(&event.xkey,0), XSymToKeySym(XLookupKeysym(&event.xkey,0)) );
|
||||
|
||||
DeviceInput di( DEVICE_KEYBOARD, XSymToKeySym(XLookupKeysym(&event.xkey,0)) );
|
||||
ButtonPressed( di, false );
|
||||
}
|
||||
}
|
||||
|
||||
InputHandler::UpdateTimer();
|
||||
}
|
||||
|
||||
|
||||
void InputHandler_X11::GetDevicesAndDescriptions(
|
||||
vector<InputDevice>& vDevicesOut, vector<CString>& vDescriptionsOut)
|
||||
void InputHandler_X11::GetDevicesAndDescriptions( vector<InputDevice>& vDevicesOut, vector<CString>& vDescriptionsOut )
|
||||
{
|
||||
vDevicesOut.push_back( DEVICE_KEYBOARD );
|
||||
vDescriptionsOut.push_back( "Keyboard" );
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* InputHandler_X11 - X-based keyboard input handler. */
|
||||
|
||||
#ifndef INPUT_HANDLER_X11_H
|
||||
#define INPUT_HANDLER_X11_H
|
||||
|
||||
/* Get keyboard (and possibly pointer in the future) input through X. */
|
||||
|
||||
#include "InputHandler.h"
|
||||
|
||||
class InputHandler_X11: public InputHandler
|
||||
@@ -11,7 +11,7 @@ public:
|
||||
InputHandler_X11();
|
||||
~InputHandler_X11();
|
||||
void Update();
|
||||
void GetDevicesAndDescriptions(vector<InputDevice>& vDevicesOut, vector<CString>& vDescriptionsOut);
|
||||
void GetDevicesAndDescriptions( vector<InputDevice>& vDevicesOut, vector<CString>& vDescriptionsOut );
|
||||
};
|
||||
#define USE_INPUT_HANDLER_X11
|
||||
|
||||
|
||||
Reference in New Issue
Block a user