* For dead keys, the keyboard input device now sends a B_UNMAPPED_KEY_DOWN
event. * This allows applications to listen to keys independent to their dead key status. * The app_server keyboard filter now also check for B_UNMAPPED_KEY_DOWN. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34112 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -711,12 +711,13 @@ KeyboardDevice::_ControlThread()
|
|||||||
if (activeDeadKey == 0 || !isKeyDown)
|
if (activeDeadKey == 0 || !isKeyDown)
|
||||||
newDeadKey = fKeymap.IsDeadKey(keycode, fModifiers);
|
newDeadKey = fKeymap.IsDeadKey(keycode, fModifiers);
|
||||||
|
|
||||||
if (newDeadKey == 0) {
|
|
||||||
char* string = NULL;
|
char* string = NULL;
|
||||||
char* rawString = NULL;
|
char* rawString = NULL;
|
||||||
int32 numBytes = 0, rawNumBytes = 0;
|
int32 numBytes = 0, rawNumBytes = 0;
|
||||||
|
if (newDeadKey == 0) {
|
||||||
fKeymap.GetChars(keycode, fModifiers, activeDeadKey, &string,
|
fKeymap.GetChars(keycode, fModifiers, activeDeadKey, &string,
|
||||||
&numBytes);
|
&numBytes);
|
||||||
|
}
|
||||||
fKeymap.GetChars(keycode, 0, 0, &rawString, &rawNumBytes);
|
fKeymap.GetChars(keycode, 0, 0, &rawString, &rawNumBytes);
|
||||||
|
|
||||||
BMessage* msg = new BMessage;
|
BMessage* msg = new BMessage;
|
||||||
@@ -760,6 +761,7 @@ KeyboardDevice::_ControlThread()
|
|||||||
|
|
||||||
delete[] rawString;
|
delete[] rawString;
|
||||||
|
|
||||||
|
if (newDeadKey == 0) {
|
||||||
if (isKeyDown && !modifiers && activeDeadKey != 0) {
|
if (isKeyDown && !modifiers && activeDeadKey != 0) {
|
||||||
// a dead key was completed
|
// a dead key was completed
|
||||||
activeDeadKey = 0;
|
activeDeadKey = 0;
|
||||||
@@ -768,22 +770,25 @@ KeyboardDevice::_ControlThread()
|
|||||||
string, true, msg);
|
string, true, msg);
|
||||||
_EnqueueInlineInputMethod(B_INPUT_METHOD_STOPPED);
|
_EnqueueInlineInputMethod(B_INPUT_METHOD_STOPPED);
|
||||||
fInputMethodStarted = false;
|
fInputMethodStarted = false;
|
||||||
} else if (fOwner->EnqueueMessage(msg) != B_OK)
|
msg = NULL;
|
||||||
delete msg;
|
}
|
||||||
} else if (fOwner->EnqueueMessage(msg) != B_OK)
|
}
|
||||||
delete msg;
|
} else if (isKeyDown
|
||||||
} else if (isKeyDown) {
|
&& _EnqueueInlineInputMethod(B_INPUT_METHOD_STARTED) == B_OK) {
|
||||||
// start of a dead key
|
// start of a dead key
|
||||||
if (_EnqueueInlineInputMethod(B_INPUT_METHOD_STARTED) == B_OK) {
|
|
||||||
char* string = NULL;
|
char* string = NULL;
|
||||||
int32 numBytes = 0;
|
int32 numBytes = 0;
|
||||||
fKeymap.GetChars(keycode, fModifiers, 0, &string, &numBytes);
|
fKeymap.GetChars(keycode, fModifiers, 0, &string, &numBytes);
|
||||||
|
|
||||||
if (_EnqueueInlineInputMethod(B_INPUT_METHOD_CHANGED, string) == B_OK)
|
if (_EnqueueInlineInputMethod(B_INPUT_METHOD_CHANGED, string)
|
||||||
|
== B_OK)
|
||||||
fInputMethodStarted = true;
|
fInputMethodStarted = true;
|
||||||
|
|
||||||
activeDeadKey = newDeadKey;
|
activeDeadKey = newDeadKey;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if (msg != NULL && fOwner->EnqueueMessage(msg) != B_OK)
|
||||||
|
delete msg;
|
||||||
|
|
||||||
lastKeyCode = isKeyDown ? keycode : 0;
|
lastKeyCode = isKeyDown ? keycode : 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ KeyboardFilter::Filter(BMessage* message, EventTarget** _target,
|
|||||||
int32 key = 0;
|
int32 key = 0;
|
||||||
int32 modifiers;
|
int32 modifiers;
|
||||||
|
|
||||||
if (message->what == B_KEY_DOWN
|
if ((message->what == B_KEY_DOWN || message->what == B_UNMAPPED_KEY_DOWN)
|
||||||
&& message->FindInt32("key", &key) == B_OK
|
&& message->FindInt32("key", &key) == B_OK
|
||||||
&& message->FindInt32("modifiers", &modifiers) == B_OK) {
|
&& message->FindInt32("modifiers", &modifiers) == B_OK) {
|
||||||
// Check for safe video mode (cmd + ctrl + escape)
|
// Check for safe video mode (cmd + ctrl + escape)
|
||||||
|
|||||||
Reference in New Issue
Block a user