diff --git a/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp b/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp index 41cb3430e2..b1e83644d9 100644 --- a/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp +++ b/src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp @@ -735,7 +735,7 @@ KeyboardDevice::_ControlThread() if (numBytes > 0) { for (int i = 0; i < numBytes; i++) msg->AddInt8("byte", (int8)string[i]); - msg->AddData("bytes", B_STRING_TYPE, string, numBytes); + msg->AddData("bytes", B_STRING_TYPE, string, numBytes + 1); if (rawNumBytes <= 0) { rawNumBytes = 1; diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index 721efee296..0093591d0c 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -1117,7 +1117,7 @@ FrameMoved(origin); ssize_t bytes; if (msg->FindData("bytes", B_STRING_TYPE, (const void**)&string, &bytes) == B_OK) { - view->KeyDown(string, bytes); + view->KeyDown(string, bytes - 1); } } else target->MessageReceived(msg); @@ -1133,7 +1133,7 @@ FrameMoved(origin); ssize_t bytes; if (msg->FindData("bytes", B_STRING_TYPE, (const void**)&string, &bytes) == B_OK) { - view->KeyUp(string, bytes); + view->KeyUp(string, bytes - 1); } } else target->MessageReceived(msg);