|
Lines 355-360
Link Here
|
| 355 |
string buffer; |
355 |
string buffer; |
| 356 |
Msg message; |
356 |
Msg message; |
| 357 |
int tu = ToUnicode ((int) msg.wParam, Control.HighOrder ((int) msg.lParam), out buffer); |
357 |
int tu = ToUnicode ((int) msg.wParam, Control.HighOrder ((int) msg.lParam), out buffer); |
|
|
358 |
|
| 359 |
/*int char_code = ((IntPtr) buffer [0]).ToInt32(); |
| 360 |
if (char_code == 8 || char_code == 127) |
| 361 |
Console.WriteLine ("TranslateMessage: {0}, {1}", char_code, tu);*/ |
| 358 |
switch (tu) { |
362 |
switch (tu) { |
| 359 |
case 1: |
363 |
case 1: |
| 360 |
message = (msg.message == Msg.WM_KEYDOWN ? Msg.WM_CHAR : Msg.WM_SYSCHAR); |
364 |
message = (msg.message == Msg.WM_KEYDOWN ? Msg.WM_CHAR : Msg.WM_SYSCHAR); |
|
Lines 444-449
Link Here
|
| 444 |
XKeySym t; |
448 |
XKeySym t; |
| 445 |
IntPtr status; |
449 |
IntPtr status; |
| 446 |
int res = LookupString (ref e, 24, out t, out status); |
450 |
int res = LookupString (ref e, 24, out t, out status); |
|
|
451 |
Console.WriteLine ("UTF.LookupString: {0}, {1}, [{2}]", t, status, lookup_buffer); |
| 447 |
int keysym = (int) t; |
452 |
int keysym = (int) t; |
| 448 |
|
453 |
|
| 449 |
buffer = String.Empty; |
454 |
buffer = String.Empty; |
|
Lines 1171-1177
Link Here
|
| 1171 |
do { |
1176 |
do { |
| 1172 |
res = Xutf8LookupString (xic, ref xevent, utf8_buffer, 100, out keysym_res, out status); |
1177 |
res = Xutf8LookupString (xic, ref xevent, utf8_buffer, 100, out keysym_res, out status); |
| 1173 |
if ((int) status != -1) // XLookupBufferOverflow |
1178 |
if ((int) status != -1) // XLookupBufferOverflow |
|
|
1179 |
{ |
| 1174 |
break; |
1180 |
break; |
|
|
1181 |
} |
| 1175 |
utf8_buffer = new byte [utf8_buffer.Length << 1]; |
1182 |
utf8_buffer = new byte [utf8_buffer.Length << 1]; |
| 1176 |
} while (true); |
1183 |
} while (true); |
| 1177 |
lookup_buffer.Length = 0; |
1184 |
lookup_buffer.Length = 0; |
|
Lines 1181-1188
Link Here
|
| 1181 |
return s.Length; |
1188 |
return s.Length; |
| 1182 |
} else { |
1189 |
} else { |
| 1183 |
lookup_buffer.Length = 0; |
1190 |
lookup_buffer.Length = 0; |
|
|
1191 |
if (xevent.type == XEventName.KeyPress && len == 24) |
| 1192 |
{ |
| 1193 |
|
| 1194 |
Console.WriteLine ("Evt: {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}", |
| 1195 |
xevent.KeyEvent.keycode, |
| 1196 |
xevent.KeyEvent.state, |
| 1197 |
xevent.KeyEvent.same_screen, |
| 1198 |
xevent.KeyEvent.send_event, |
| 1199 |
xevent.KeyEvent.time, |
| 1200 |
xevent.KeyEvent.serial, |
| 1201 |
xevent.KeyEvent.root, |
| 1202 |
xevent.KeyEvent.display, |
| 1203 |
xevent.KeyEvent.subwindow, |
| 1204 |
xevent.KeyEvent.window); |
| 1205 |
} |
| 1184 |
res = XLookupString (ref xevent, lookup_buffer, len, out keysym_res, IntPtr.Zero); |
1206 |
res = XLookupString (ref xevent, lookup_buffer, len, out keysym_res, IntPtr.Zero); |
| 1185 |
keysym = (XKeySym) keysym_res.ToInt32 (); |
1207 |
keysym = (XKeySym) keysym_res.ToInt32 (); |
|
|
1208 |
if (xevent.type == XEventName.KeyPress && len == 24) |
| 1209 |
{ |
| 1210 |
Console.WriteLine ("Non-XIC: {0}, {1}, [{2}], {3}", keysym, res, lookup_buffer, len); |
| 1211 |
} |
| 1186 |
return res; |
1212 |
return res; |
| 1187 |
} |
1213 |
} |
| 1188 |
} |
1214 |
} |