ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.441 by root, Tue Mar 30 23:54:29 2010 UTC vs.
Revision 1.450 by sf-exg, Sun Apr 18 11:11:28 2010 UTC

198 198
199 int width = 0; 199 int width = 0;
200 fname = rxvt_temp_buf<wchar_t *> (len); 200 fname = rxvt_temp_buf<wchar_t *> (len);
201 for (int i = 0; i < len; i++) 201 for (int i = 0; i < len; i++)
202 { 202 {
203 rxvt_font *f = (*fs)[fs->find_font (chr[i])]; 203 rxvt_font *f = (*fs)[fs->find_font_idx (chr[i])];
204 fname[i] = rxvt_utf8towcs (f->name); 204 fname[i] = rxvt_utf8towcs (f->name);
205 max_it (width, wcswidth (fname[i], wcslen (fname[i]))); 205 max_it (width, wcswidth (fname[i], wcslen (fname[i])));
206 } 206 }
207 207
208 max_it (width, 8+5); // for char + hex 208 max_it (width, 8+5); // for char + hex
288} 288}
289 289
290static int 290static int
291hex_keyval (XKeyEvent &ev) 291hex_keyval (XKeyEvent &ev)
292{ 292{
293 // check wether this event corresponds to a hex digit 293 // check whether this event corresponds to a hex digit
294 // if the modifiers had not been pressed. 294 // if the modifiers had not been pressed.
295 for (int index = 0; index < 8; index++) 295 for (int index = 0; index < 8; index++)
296 { 296 {
297 KeySym k = XLookupKeysym (&ev, index); 297 KeySym k = XLookupKeysym (&ev, index);
298 298
421 * Always permit `shift' to override the current setting 421 * Always permit `shift' to override the current setting
422 */ 422 */
423 shft = ev.state & ShiftMask; 423 shft = ev.state & ShiftMask;
424 ctrl = ev.state & ControlMask; 424 ctrl = ev.state & ControlMask;
425 meta = ev.state & ModMetaMask; 425 meta = ev.state & ModMetaMask;
426
427 if (numlock_state || (ev.state & ModNumLockMask))
428 {
429 numlock_state = (ev.state & ModNumLockMask);
430 set_privmode (PrivMode_aplKP, !numlock_state);
431 }
432 426
433 kbuf[0] = 0; 427 kbuf[0] = 0;
434 428
435#ifdef USE_XIM 429#ifdef USE_XIM
436 if (Input_Context) 430 if (Input_Context)
653 if (keysym >= 0xFF00 && keysym <= 0xFFFF) 647 if (keysym >= 0xFF00 && keysym <= 0xFFFF)
654 { 648 {
655 bool kp = priv_modes & PrivMode_aplKP ? !shft : shft; 649 bool kp = priv_modes & PrivMode_aplKP ? !shft : shft;
656 unsigned int newlen = 1; 650 unsigned int newlen = 1;
657 651
652 if (ev.state & ModNumLockMask)
653 kp = false;
654
658 switch (translate_keypad (keysym, kp)) 655 keysym = translate_keypad (keysym, kp);
656
657 switch (keysym)
659 { 658 {
660#ifndef NO_BACKSPACE_KEY 659#ifndef NO_BACKSPACE_KEY
661 case XK_BackSpace: 660 case XK_BackSpace:
662 if (priv_modes & PrivMode_HaveBackSpace) 661 if (priv_modes & PrivMode_HaveBackSpace)
663 { 662 {
1033 } 1032 }
1034 1033
1035 display->flush (); 1034 display->flush ();
1036} 1035}
1037 1036
1038/* checks wether a refresh is requested and starts the refresh timer */ 1037/* checks whether a refresh is requested and starts the refresh timer */
1039void 1038void
1040rxvt_term::refresh_check () 1039rxvt_term::refresh_check ()
1041{ 1040{
1042 if (want_refresh && !flush_ev.is_active ()) 1041 if (want_refresh && !flush_ev.is_active ())
1043 flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally 1042 flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally
1137 // this should really be sched_yield(), but the linux guys thought 1136 // this should really be sched_yield(), but the linux guys thought
1138 // that giving a process calling sched_yield () less cpu time than 1137 // that giving a process calling sched_yield () less cpu time than
1139 // ones with high nice levels is a useful thing to do. It surely is is 1138 // ones with high nice levels is a useful thing to do. It surely is is
1140 // allowed by the sus... as is returning ENOSYS. 1139 // allowed by the sus... as is returning ENOSYS.
1141 // since the linux guys additionally thought that breaking the only 1140 // since the linux guys additionally thought that breaking the only
1142 // known workaroudn against their unusable sched_yield hack is cool, 1141 // known workaround against their unusable sched_yield hack is cool,
1143 // we just nanosleep a bit and hope for the best. 1142 // we just nanosleep a bit and hope for the best.
1144 1143
1145 struct timespec ts = { 0, 1000 }; 1144 struct timespec ts = { 0, 1000 };
1146 nanosleep (&ts, 0); 1145 nanosleep (&ts, 0);
1147 1146
2151 selection_make (ev.time); 2150 selection_make (ev.time);
2152 break; 2151 break;
2153 2152
2154 case Button2: 2153 case Button2:
2155 if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? 2154 if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window?
2156 selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary); 2155 selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary);
2157 break; 2156 break;
2158 2157
2159#ifdef MOUSE_WHEEL 2158#ifdef MOUSE_WHEEL
2160 case Button4: 2159 case Button4:
2161 case Button5: 2160 case Button5:
3395 process_color_seq (op, Color_pointer_fg, str, resp); 3394 process_color_seq (op, Color_pointer_fg, str, resp);
3396 break; 3395 break;
3397 case XTerm_Color_pointer_bg: 3396 case XTerm_Color_pointer_bg:
3398 process_color_seq (op, Color_pointer_bg, str, resp); 3397 process_color_seq (op, Color_pointer_bg, str, resp);
3399 break; 3398 break;
3399#ifdef OPTION_HC
3400 case XTerm_Color_HC:
3401 process_color_seq (op, Color_HC, str, resp);
3402 break;
3403 case XTerm_Color_HTC:
3404 process_color_seq (op, Color_HTC, str, resp);
3405 break;
3406#endif
3400#ifndef NO_BOLD_UNDERLINE_REVERSE 3407#ifndef NO_BOLD_UNDERLINE_REVERSE
3401 case XTerm_Color_RV:
3402 process_color_seq (op, Color_RV, str, resp);
3403 break;
3404 case Rxvt_Color_BD:
3405 case URxvt_Color_BD: 3408 case URxvt_Color_BD:
3406 process_color_seq (op, Color_BD, str, resp); 3409 process_color_seq (op, Color_BD, str, resp);
3407 break; 3410 break;
3408 case Rxvt_Color_UL:
3409 case URxvt_Color_UL: 3411 case URxvt_Color_UL:
3410 process_color_seq (op, Color_UL, str, resp); 3412 process_color_seq (op, Color_UL, str, resp);
3411 break; 3413 break;
3412 case URxvt_Color_IT: 3414 case URxvt_Color_IT:
3413 process_color_seq (op, Color_IT, str, resp); 3415 process_color_seq (op, Color_IT, str, resp);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines