From: root
Date: Fri, 22 Apr 2005 02:09:39 +0000 (+0000)
Subject: *** empty log message ***
X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=d4e2c2d54b0539bda08c57cea7da0246a87e606e;p=dana%2Furxvt.git
*** empty log message ***
---
diff --git a/Changes b/Changes
index 4d708bcd..af4d10bf 100644
--- a/Changes
+++ b/Changes
@@ -11,6 +11,11 @@ WISH: OnTheSpot editing, or maybe switch to miiiiiiif
WISH: tabbed windows (hey, just use screen...)
WISH: just for fun, do shade and tint with XRender.
+5.5
+ - re-enabled modifer state matching as in 5.3, but implement
+ a new builtin: keysym style that simply reverts to the built-in
+ meaning of the given key.
+
5.4 Mon Apr 18 00:33:31 CEST 2005
- match modifier state exactly in custom keyboard code.
this is necessary because it has no knowledge about
diff --git a/doc/rxvt.1.html b/doc/rxvt.1.html
index 13acfc70..cf1770ac 100644
--- a/doc/rxvt.1.html
+++ b/doc/rxvt.1.html
@@ -49,7 +49,7 @@
-rxvt-unicode, version 5.3, is a colour vt102 terminal
+
rxvt-unicode, version 5.5, is a colour vt102 terminal
emulator intended as an xterm(1) replacement for users who do not
require features such as Tektronix 4014 emulation and toolkit-style
configurability. As a result, rxvt-unicode uses much less swap space --
@@ -1285,6 +1285,30 @@ when Control-Meta-c is being pressed'':
URxvt.keysym.M-C-c: command:\033]701;zh_CN.GBK\007
+Due the the large number of modifier combinations, a defined key mapping
+will match if at at least the specified identifiers are being set, and
+no other key mappings with those and more bits are being defined. That
+means that defining a key map for a
will automatically provide
+definitions for Meta-a
, Shift-a
and so on, unless some of those are defined
+mappings themselves.
+
+
+Unfortunately, this will override built-in key mappings. For example
+if you overwrite the Insert
key you will disable rxvt's
+Shift-Insert
mapping. To re-enable that, you can poke ``holes'' into the
+user-defined keymap using the builtin:
replacement:
+
+
+
+ URxvt.keysym.Insert: <my insert key sequence>
+ URxvt.keysym.S-Insert: builtin:
+
+
+The first line defines a mapping for Insert
and any combination
+of modifiers. The second line re-establishes the default mapping for
+Shift-Insert
.
+
+
The following example will map Control-Meta-1 and Control-Meta-2 to
the fonts suxuseuro
and 9x15bold
, so you can have some limited
font-switching at runtime:
diff --git a/doc/rxvt.1.man.in b/doc/rxvt.1.man.in
index 5d2190b7..fb7ea088 100644
--- a/doc/rxvt.1.man.in
+++ b/doc/rxvt.1.man.in
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "rxvt 1"
-.TH rxvt 1 "2005-04-17" "5.3" "RXVT-UNICODE"
+.TH rxvt 1 "2005-04-22" "5.5" "RXVT-UNICODE"
.SH "NAME"
rxvt\-unicode (ouR XVT, unicode) \- (a VT102 emulator for the X window system)
.SH "SYNOPSIS"
@@ -980,6 +980,27 @@ when Control-Meta-c is being pressed":
\& URxvt.keysym.M-C-c: command:\e033]701;zh_CN.GBK\e007
.Ve
.Sp
+Due the the large number of modifier combinations, a defined key mapping
+will match if at \fIat least\fR the specified identifiers are being set, and
+no other key mappings with those and more bits are being defined. That
+means that defining a key map for \f(CW\*(C`a\*(C'\fR will automatically provide
+definitions for \f(CW\*(C`Meta\-a\*(C'\fR, \f(CW\*(C`Shift\-a\*(C'\fR and so on, unless some of those are defined
+mappings themselves.
+.Sp
+Unfortunately, this will override built-in key mappings. For example
+if you overwrite the \f(CW\*(C`Insert\*(C'\fR key you will disable @@RXVT_NAME@@'s
+\&\f(CW\*(C`Shift\-Insert\*(C'\fR mapping. To re-enable that, you can poke \*(L"holes\*(R" into the
+user-defined keymap using the \f(CW\*(C`builtin:\*(C'\fR replacement:
+.Sp
+.Vb 2
+\& URxvt.keysym.Insert:
+\& URxvt.keysym.S-Insert: builtin:
+.Ve
+.Sp
+The first line defines a mapping for \f(CW\*(C`Insert\*(C'\fR and \fIany\fR combination
+of modifiers. The second line re-establishes the default mapping for
+\&\f(CW\*(C`Shift\-Insert\*(C'\fR.
+.Sp
The following example will map Control\-Meta\-1 and Control\-Meta\-2 to
the fonts \f(CW\*(C`suxuseuro\*(C'\fR and \f(CW\*(C`9x15bold\*(C'\fR, so you can have some limited
font-switching at runtime:
diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod
index 91b9ab19..26aaa531 100644
--- a/doc/rxvt.1.pod
+++ b/doc/rxvt.1.pod
@@ -960,6 +960,25 @@ when Control-Meta-c is being pressed":
URxvt.keysym.M-C-c: command:\033]701;zh_CN.GBK\007
+Due the the large number of modifier combinations, a defined key mapping
+will match if at I the specified identifiers are being set, and
+no other key mappings with those and more bits are being defined. That
+means that defining a key map for C will automatically provide
+definitions for C, C and so on, unless some of those are defined
+mappings themselves.
+
+Unfortunately, this will override built-in key mappings. For example
+if you overwrite the C key you will disable @@RXVT_NAME@@'s
+C mapping. To re-enable that, you can poke "holes" into the
+user-defined keymap using the C replacement:
+
+ URxvt.keysym.Insert:
+ URxvt.keysym.S-Insert: builtin:
+
+The first line defines a mapping for C and I combination
+of modifiers. The second line re-establishes the default mapping for
+C.
+
The following example will map Control-Meta-1 and Control-Meta-2 to
the fonts C and C<9x15bold>, so you can have some limited
font-switching at runtime:
diff --git a/doc/rxvt.1.txt b/doc/rxvt.1.txt
index 86481e46..c7652a4e 100644
--- a/doc/rxvt.1.txt
+++ b/doc/rxvt.1.txt
@@ -6,7 +6,7 @@ SYNOPSIS
rxvt [options] [-e command [ args ]]
DESCRIPTION
- rxvt-unicode, version 5.3, is a colour vt102 terminal emulator intended
+ rxvt-unicode, version 5.5, is a colour vt102 terminal emulator intended
as an *xterm*(1) replacement for users who do not require features such
as Tektronix 4014 emulation and toolkit-style configurability. As a
result, rxvt-unicode uses much less swap space -- a significant
@@ -827,6 +827,25 @@ RESOURCES (available also as long-options)
URxvt.keysym.M-C-c: command:\033]701;zh_CN.GBK\007
+ Due the the large number of modifier combinations, a defined key
+ mapping will match if at *at least* the specified identifiers are
+ being set, and no other key mappings with those and more bits are
+ being defined. That means that defining a key map for "a" will
+ automatically provide definitions for "Meta-a", "Shift-a" and so on,
+ unless some of those are defined mappings themselves.
+
+ Unfortunately, this will override built-in key mappings. For example
+ if you overwrite the "Insert" key you will disable rxvt's
+ "Shift-Insert" mapping. To re-enable that, you can poke "holes" into
+ the user-defined keymap using the "builtin:" replacement:
+
+ URxvt.keysym.Insert:
+ URxvt.keysym.S-Insert: builtin:
+
+ The first line defines a mapping for "Insert" and *any* combination
+ of modifiers. The second line re-establishes the default mapping for
+ "Shift-Insert".
+
The following example will map Control-Meta-1 and Control-Meta-2 to
the fonts "suxuseuro" and "9x15bold", so you can have some limited
font-switching at runtime:
diff --git a/src/keyboard.C b/src/keyboard.C
index c74120da..2e58f572 100644
--- a/src/keyboard.C
+++ b/src/keyboard.C
@@ -217,6 +217,8 @@ keyboard_manager::register_user_translation (KeySym keysym, unsigned int state,
else
rxvt_warn ("cannot parse list-type keysym '%s', treating as normal keysym.\n", translation);
}
+ else if (strncmp (translation, "builtin:", 8) == 0)
+ key->type = keysym_t::BUILTIN;
user_keymap.push_back (key);
user_translations.push_back (translation);
@@ -277,64 +279,67 @@ keyboard_manager::dispatch (rxvt_term *term, KeySym keysym, unsigned int state)
{
const keysym_t &key = *keymap [index];
- int keysym_offset = keysym - key.keysym;
-
- wchar_t *wc = rxvt_utf8towcs (key.str);
- char *str = rxvt_wcstombs (wc);
- // TODO: do (some) translations, unescaping etc, here (allow \u escape etc.)
- free (wc);
-
- switch (key.type)
+ if (key.type != keysym_t::BUILTIN)
{
- case keysym_t::NORMAL:
- output_string (term, str);
- break;
+ int keysym_offset = keysym - key.keysym;
+
+ wchar_t *wc = rxvt_utf8towcs (key.str);
+ char *str = rxvt_wcstombs (wc);
+ // TODO: do (some) translations, unescaping etc, here (allow \u escape etc.)
+ free (wc);
- case keysym_t::RANGE:
+ switch (key.type)
{
- char buf[STRING_MAX];
+ case keysym_t::NORMAL:
+ output_string (term, str);
+ break;
- if (format_keyrange_string (str, keysym_offset, buf, sizeof (buf)) > 0)
- output_string (term, buf);
- }
- break;
+ case keysym_t::RANGE:
+ {
+ char buf[STRING_MAX];
- case keysym_t::RANGE_META8:
- {
- int len;
- char buf[STRING_MAX];
+ if (format_keyrange_string (str, keysym_offset, buf, sizeof (buf)) > 0)
+ output_string (term, buf);
+ }
+ break;
- len = format_keyrange_string (str, keysym_offset, buf, sizeof (buf));
- if (len > 0)
- output_string_meta8 (term, state, buf, len);
- }
- break;
+ case keysym_t::RANGE_META8:
+ {
+ int len;
+ char buf[STRING_MAX];
- case keysym_t::LIST:
- {
- char buf[STRING_MAX];
+ len = format_keyrange_string (str, keysym_offset, buf, sizeof (buf));
+ if (len > 0)
+ output_string_meta8 (term, state, buf, len);
+ }
+ break;
+
+ case keysym_t::LIST:
+ {
+ char buf[STRING_MAX];
- char *prefix, *middle, *suffix;
+ char *prefix, *middle, *suffix;
- prefix = str;
- middle = strchr (prefix + 1, *prefix);
- suffix = strrchr (middle + 1, *prefix);
+ prefix = str;
+ middle = strchr (prefix + 1, *prefix);
+ suffix = strrchr (middle + 1, *prefix);
- memcpy (buf, prefix + 1, middle - prefix - 1);
- buf [middle - prefix - 1] = middle [keysym_offset + 1];
- strcpy (buf + (middle - prefix), suffix + 1);
+ memcpy (buf, prefix + 1, middle - prefix - 1);
+ buf [middle - prefix - 1] = middle [keysym_offset + 1];
+ strcpy (buf + (middle - prefix), suffix + 1);
- output_string (term, buf);
+ output_string (term, buf);
+ }
+ break;
}
- break;
- }
- free (str);
+ free (str);
- return true;
+ return true;
+ }
}
- else
- return false;
+
+ return false;
}
// purge duplicate keymap entries
@@ -461,13 +466,8 @@ keyboard_manager::find_keysym (KeySym keysym, unsigned int state)
keysym_t *key = keymap [index];
if (key->keysym <= keysym && keysym < key->keysym + key->range
-#if 0 // disabled because the custom ekymap does not know the builtin keymap
// match only the specified bits in state and ignore others
- && (key->state & state) == key->state
-#else // re-enable this part once the builtin keymap is handled here, too
- && key->state == state
-#endif
- )
+ && (key->state & state) == key->state)
return index;
}
diff --git a/src/keyboard.h b/src/keyboard.h
index f83ba97d..e60cf3bf 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -34,7 +34,7 @@ typedef void (keyevent_handler) (rxvt_term *rt,
struct keysym_t
{
enum keysym_type {
- NORMAL, RANGE, RANGE_META8, LIST
+ NORMAL, RANGE, RANGE_META8, LIST, BUILTIN,
};
KeySym keysym;
diff --git a/src/version.h b/src/version.h
index 4d992fa2..ad05bffe 100644
--- a/src/version.h
+++ b/src/version.h
@@ -1,3 +1,3 @@
// VERSION _must_ be \d.\d+
-#define VERSION "5.4"
+#define VERSION "5.5"
#define DATE "2005-04-18"