| 338 result_len = g_unichar_to_utf8(ch, k); |
338 result_len = g_unichar_to_utf8(ch, k); |
| 339 k += result_len; |
339 k += result_len; |
| 340 } |
340 } |
| 341 *k = '\0'; |
341 *k = '\0'; |
| 342 |
342 |
| 343 #if 0 |
|
| 344 gnt_warning("a key: [%s] %#x %#x %#x %#x %#x %#x", keys, |
|
| 345 (guchar)keys[0], (guchar)keys[1], (guchar)keys[2], |
|
| 346 (guchar)keys[3], (guchar)keys[4], (guchar)keys[5]); |
|
| 347 #endif |
|
| 348 |
|
| 349 /* TODO: we could call detect_mouse_action here, but no |
343 /* TODO: we could call detect_mouse_action here, but no |
| 350 * events are triggered (yet?) for mouse on win32. |
344 * events are triggered (yet?) for mouse on win32. |
| 351 */ |
345 */ |
| 352 |
346 |
| 353 gnt_wm_process_input(wm, keys); |
347 gnt_wm_process_input(wm, keys); |
| 393 cvrt = g_locale_to_utf8(keys, rd, (gsize*)&rd, NULL, NULL); |
387 cvrt = g_locale_to_utf8(keys, rd, (gsize*)&rd, NULL, NULL); |
| 394 k = cvrt ? cvrt : keys; |
388 k = cvrt ? cvrt : keys; |
| 395 if (mouse_enabled && detect_mouse_action(k)) |
389 if (mouse_enabled && detect_mouse_action(k)) |
| 396 goto end; |
390 goto end; |
| 397 |
391 |
| 398 #if 0 |
|
| 399 /* I am not sure what's happening here. If this actually does something, |
|
| 400 * then this needs to go in gnt_keys_refine. */ |
|
| 401 if (*k < 0) { /* Alt not sending ESC* */ |
|
| 402 *(k + 1) = 128 - *k; |
|
| 403 *k = 27; |
|
| 404 *(k + 2) = 0; |
|
| 405 rd++; |
|
| 406 } |
|
| 407 #endif |
|
| 408 |
|
| 409 while (rd) { |
392 while (rd) { |
| 410 char back; |
393 char back; |
| 411 int p; |
394 int p; |
| 412 |
395 |
| 413 if (k[0] == '\033' && rd == 1) { |
396 if (k[0] == '\033' && rd == 1) { |
| 448 return; |
431 return; |
| 449 } |
432 } |
| 450 |
433 |
| 451 g_io_channel_set_close_on_unref(channel, TRUE); |
434 g_io_channel_set_close_on_unref(channel, TRUE); |
| 452 |
435 |
| 453 #if 0 |
|
| 454 g_io_channel_set_encoding(channel, NULL, NULL); |
|
| 455 g_io_channel_set_buffered(channel, FALSE); |
|
| 456 g_io_channel_set_flags(channel, G_IO_FLAG_NONBLOCK, NULL ); |
|
| 457 #endif |
|
| 458 |
|
| 459 channel_read_callback = result = g_io_add_watch_full(channel, G_PRIORITY_HIGH, |
436 channel_read_callback = result = g_io_add_watch_full(channel, G_PRIORITY_HIGH, |
| 460 (G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI), |
437 (G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI), |
| 461 io_invoke, NULL, NULL); |
438 io_invoke, NULL, NULL); |
| 462 |
439 |
| 463 channel_error_callback = g_io_add_watch_full(channel, G_PRIORITY_HIGH, |
440 channel_error_callback = g_io_add_watch_full(channel, G_PRIORITY_HIGH, |
| 464 (G_IO_NVAL), |
441 (G_IO_NVAL), |
| 465 io_invoke_error, GINT_TO_POINTER(result), NULL); |
442 io_invoke_error, GINT_TO_POINTER(result), NULL); |
| 466 |
443 |
| 467 g_io_channel_unref(channel); |
444 g_io_channel_unref(channel); |
| 468 |
|
| 469 #if 0 |
|
| 470 gnt_warning("setting up IO (%d)", channel_read_callback); |
|
| 471 #endif |
|
| 472 } |
445 } |
| 473 |
446 |
| 474 static gboolean |
447 static gboolean |
| 475 refresh_screen(void) |
448 refresh_screen(void) |
| 476 { |
449 { |