- Timestamp:
- Jan 9, 2008, 2:17:57 PM (17 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 369479d
- Parents:
- c10fef0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
owl.c
rc10fef0 r428834d 71 71 owl_popwin *pw; 72 72 int ret, initialsubs, debug, argcsave, followlast; 73 gunicharj;73 owl_input j; 74 74 int newmsgs, nexttimediff; 75 75 struct sigaction sigact; … … 546 546 * little bit, but otherwise do not. This lets input be grabbed 547 547 * as quickly as possbile */ 548 j=wgetch(typwin); 549 if (j == ERR 550 #ifdef KEY_RESIZE 551 || j == KEY_RESIZE 552 #endif 553 ) { 548 j.ch = wgetch(typwin); 549 if (j.ch == ERR) { 554 550 usleep(10000); 555 551 } else { 556 /* Pull in a full utf-8 character. */ 557 if (j & 0x80) { 558 char utf8buf[7]; 552 j.uch = '\0'; 553 if (j.ch >= KEY_MIN && j.ch <= KEY_MAX) { 554 /* This is a curses control character. */ 555 } 556 else if (j.ch > 0x7f && j.ch < 0xfe) { 557 /* Pull in a full utf-8 character. */ 559 558 int bytes, i; 560 memset(utf8buf,'\0',7); 561 utf8buf[0] = j; 562 563 if ((j & 0xc0) && (~j & 0x20)) bytes = 2; 564 else if ((j & 0xe0) && (~j & 0x10)) bytes = 3; 565 else if ((j & 0xf0) && (~j & 0x08)) bytes = 4; 566 else if ((j & 0xf8) && (~j & 0x04)) bytes = 5; 567 else if ((j & 0xfc) && (~j & 0x02)) bytes = 6; 559 char *utf8buf[7]; 560 memset(utf8buf, '\0', 7); 561 562 utf8buf[0] = j.ch; 563 564 if ((j.ch & 0xc0) && (~j.ch & 0x20)) bytes = 2; 565 else if ((j.ch & 0xe0) && (~j.ch & 0x10)) bytes = 3; 566 else if ((j.ch & 0xf0) && (~j.ch & 0x08)) bytes = 4; 567 else if ((j.ch & 0xf8) && (~j.ch & 0x04)) bytes = 5; 568 else if ((j.ch & 0xfc) && (~j.ch & 0x02)) bytes = 6; 568 569 else bytes = 1; 569 570 … … 572 573 } 573 574 if (g_utf8_validate(utf8buf, -1, NULL)) { 574 j = g_utf8_get_char(utf8buf);575 j.uch = g_utf8_get_char(utf8buf); 575 576 } 576 577 else { 577 j = ERR;578 j.ch = ERR; 578 579 } 579 580 } 581 else if (j.ch <= 0x7f) { 582 j.uch = j.ch; 583 } 584 580 585 owl_global_update_lastinputtime(&g); 581 586 /* find and activate the current keymap.
Note: See TracChangeset
for help on using the changeset viewer.