Implemented the patch on #7963 in a different way.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43037 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f6df6995b6
commit
0fa3181d95
@ -23,6 +23,7 @@
|
||||
#define IS_GET_MOUSE_MAP 'Igmm'
|
||||
#define IS_SET_MOUSE_MAP 'Ismm'
|
||||
#define IS_GET_KEYBOARD_ID 'Igid'
|
||||
#define IS_SET_KEYBOARD_ID 'Isid'
|
||||
#define IS_GET_CLICK_SPEED 'Igcs'
|
||||
#define IS_SET_CLICK_SPEED 'Iscs'
|
||||
#define IS_GET_KEY_REPEAT_RATE 'Igrr'
|
||||
|
@ -131,6 +131,7 @@ KeyboardDevice::KeyboardDevice(KeyboardInputDevice* owner, const char* path)
|
||||
fThread(-1),
|
||||
fActive(false),
|
||||
fInputMethodStarted(false),
|
||||
fKeyboardID(0),
|
||||
fUpdateSettings(false),
|
||||
fSettingsCommand(0),
|
||||
fKeymapLock("keymap lock")
|
||||
@ -281,6 +282,14 @@ KeyboardDevice::_ControlThread()
|
||||
|
||||
memset(states, 0, sizeof(states));
|
||||
|
||||
if (fKeyboardID == 0) {
|
||||
if (ioctl(fFD, KB_GET_KEYBOARD_ID, &fKeyboardID) == 0) {
|
||||
BMessage message(IS_SET_KEYBOARD_ID);
|
||||
message.AddInt16("id", fKeyboardID);
|
||||
be_app->PostMessage(&message);
|
||||
}
|
||||
}
|
||||
|
||||
while (fActive) {
|
||||
if (ioctl(fFD, KB_READ, &keyInfo, sizeof(keyInfo)) != B_OK) {
|
||||
_ControlThreadCleanup();
|
||||
|
@ -61,6 +61,7 @@ private:
|
||||
uint32 fModifiers;
|
||||
uint32 fCommandKey;
|
||||
uint32 fControlKey;
|
||||
uint16 fKeyboardID;
|
||||
|
||||
volatile bool fUpdateSettings;
|
||||
volatile uint32 fSettingsCommand;
|
||||
|
@ -510,7 +510,10 @@ InputServer::MessageReceived(BMessage* message)
|
||||
status = HandleGetSetMouseMap(message, &reply);
|
||||
break;
|
||||
case IS_GET_KEYBOARD_ID:
|
||||
status = HandleGetKeyboardID(message, &reply);
|
||||
status = HandleGetSetKeyboardID(message, &reply);
|
||||
break;
|
||||
case IS_SET_KEYBOARD_ID:
|
||||
status = HandleGetSetKeyboardID(message, &reply);
|
||||
break;
|
||||
case IS_GET_CLICK_SPEED:
|
||||
status = HandleGetSetClickSpeed(message, &reply);
|
||||
@ -870,8 +873,14 @@ InputServer::HandleGetSetMouseMap(BMessage* message, BMessage* reply)
|
||||
|
||||
|
||||
status_t
|
||||
InputServer::HandleGetKeyboardID(BMessage* message, BMessage* reply)
|
||||
InputServer::HandleGetSetKeyboardID(BMessage* message, BMessage* reply)
|
||||
{
|
||||
int16 id;
|
||||
message->PrintToStream();
|
||||
if (message->FindInt16("id", &id) == B_OK) {
|
||||
fKeyboardID = (uint16)id;
|
||||
return B_OK;
|
||||
}
|
||||
return reply->AddInt16("id", fKeyboardID);
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ class InputServer : public BApplication {
|
||||
status_t HandleGetSetMouseSpeed(BMessage* message, BMessage* reply);
|
||||
status_t HandleSetMousePosition(BMessage* message, BMessage* reply);
|
||||
status_t HandleGetSetMouseMap(BMessage* message, BMessage* reply);
|
||||
status_t HandleGetKeyboardID(BMessage* message, BMessage* reply);
|
||||
status_t HandleGetSetKeyboardID(BMessage* message, BMessage* reply);
|
||||
status_t HandleGetSetClickSpeed(BMessage* message, BMessage* reply);
|
||||
status_t HandleGetSetKeyRepeatRate(BMessage* message, BMessage* reply);
|
||||
status_t HandleGetSetKeyMap(BMessage* message, BMessage* reply);
|
||||
|
Loading…
x
Reference in New Issue
Block a user