--- rxvt-unicode/src/rxvtperl.xs 2006/02/04 16:12:48 1.97 +++ rxvt-unicode/src/rxvtperl.xs 2006/02/06 05:40:15 1.98 @@ -925,14 +925,14 @@ int SET_FGCOLOR (int rend, int new_color) CODE: - RETVAL = SET_FGCOLOR (rend, new_color); + RETVAL = SET_FGCOLOR (rend, clamp (new_color, 0, TOTAL_COLORS - 1)); OUTPUT: RETVAL int SET_BGCOLOR (int rend, int new_color) CODE: - RETVAL = SET_BGCOLOR (rend, new_color); + RETVAL = SET_BGCOLOR (rend, clamp (new_color, 0, TOTAL_COLORS - 1)); OUTPUT: RETVAL @@ -1294,6 +1294,32 @@ rxvt_term::focus_out () void +rxvt_term::key_press (unsigned int state, unsigned int keycode, Time time = CurrentTime) + ALIAS: + key_release = 1 + CODE: +{ + XKeyEvent xkey; + + memset (&xkey, 0, sizeof (xkey)); + + xkey.time = time; + xkey.state = state; + xkey.keycode = keycode; + + xkey.type = ix ? KeyRelease : KeyPress; + xkey.display = THIS->dpy; + xkey.window = THIS->vt; + xkey.root = THIS->display->root; + xkey.subwindow = THIS->vt; + + if (ix) + THIS->key_release (xkey); + else + THIS->key_press (xkey); +} + +void rxvt_term::want_refresh () CODE: THIS->want_refresh = 1;