Ticket #4648: alternative_cspace_patch.diff
File alternative_cspace_patch.diff, 2.7 KB (added by , 15 years ago) |
---|
-
src/kits/interface/Window.cpp
1114 1114 // different font encoding per view (it's supposed to be 1115 1115 // converted by _HandleKeyDown() one day) 1116 1116 const char* string; 1117 if (msg->FindString("bytes", &string) == B_OK) 1118 view->KeyDown(string, strlen(string)); 1117 ssize_t bytes; 1118 if (msg->FindData("bytes", B_STRING_TYPE, 1119 (const void**)&string, &bytes) == B_OK) { 1120 view->KeyDown(string, bytes); 1121 } 1119 1122 } else 1120 1123 target->MessageReceived(msg); 1121 1124 } … … 1124 1127 1125 1128 case B_KEY_UP: 1126 1129 { 1127 const char* string = NULL;1128 msg->FindString("bytes", &string);1129 1130 1130 // TODO: same as above 1131 if (BView* view = dynamic_cast<BView*>(target)) 1132 view->KeyUp(string, strlen(string)); 1133 else 1131 if (BView* view = dynamic_cast<BView*>(target)) { 1132 const char* string; 1133 ssize_t bytes; 1134 if (msg->FindData("bytes", B_STRING_TYPE, 1135 (const void**)&string, &bytes) == B_OK) { 1136 view->KeyUp(string, bytes); 1137 } 1138 } else 1134 1139 target->MessageReceived(msg); 1135 1140 break; 1136 1141 } -
src/add-ons/input_server/devices/keyboard/KeyboardInputDevice.cpp
1 1 /* 2 2 * Copyright 2004-2006, Jérôme Duval. All rights reserved. 3 3 * Copyright 2005-2008, Axel Dörfler, axeld@pinc-software.de. 4 * Copyright 2008 , Stephan Aßmus, superstippi@gmx.de.4 * Copyright 2008-2009, Stephan Aßmus, superstippi@gmx.de. 5 5 * 6 6 * Distributed under the terms of the MIT License. 7 7 */ … … 43 43 fFunctionDepth++; 44 44 fPrepend.Append(' ', fFunctionDepth * 2); 45 45 fFunctionName << className << "::" << functionName << "()"; 46 46 47 47 debug_printf("%p -> %s%s {\n", fPointer, fPrepend.String(), 48 48 fFunctionName.String()); 49 49 } 50 50 51 51 ~FunctionTracer() 52 52 { 53 53 debug_printf("%p -> %s}\n", fPointer, fPrepend.String()); 54 54 fFunctionDepth--; 55 55 } 56 56 57 57 private: 58 58 BString fFunctionName; 59 59 BString fPrepend; … … 733 733 msg->AddInt32("modifiers", fModifiers); 734 734 msg->AddData("states", B_UINT8_TYPE, states, 16); 735 735 if (numBytes > 0) { 736 for (int i = 0; i < numBytes; i++) {736 for (int i = 0; i < numBytes; i++) 737 737 msg->AddInt8("byte", (int8)string[i]); 738 } 739 msg->AddString("bytes", string); 738 msg->AddData("bytes", B_STRING_TYPE, string, numBytes); 740 739 741 740 if (rawNumBytes <= 0) { 742 741 rawNumBytes = 1;