aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1993-06-05 07:56:46 +0000
committerRichard M. Stallman <[email protected]>1993-06-05 07:56:46 +0000
commitfc4f24da5c464976f2d4be1370ee1121a86bd5c4 (patch)
treed70adc63726c1141249242fb37debffe98f3d23f
parent14869f462178bad94f1f6ddc0f1a49b14c1f2252 (diff)
(term_get_fkeys): Use correct names for F10 and up.
Use the key sequence, not the termcap cap name, in Fdefine_key.
-rw-r--r--src/term.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/term.c b/src/term.c
index 6d4cba2a10..911f9f1fee 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1281,7 +1281,7 @@ term_get_fkeys (address)
{
char fcap[3], fkey[4];
- fcap[0] = 'k'; fcap[2] = '\0';
+ fcap[0] = 'F'; fcap[2] = '\0';
for (i = 11; i < 64; i++)
{
if (i <= 19)
@@ -1291,13 +1291,16 @@ term_get_fkeys (address)
else
fcap[1] = 'a' + i - 11;
- if (tgetstr (fcap, address))
- {
- (void) sprintf (fkey, "f%d", i);
- Fdefine_key (Vfunction_key_map,
- build_string (fcap),
- Fmake_vector (make_number (1), intern (fkey)));
- }
+ {
+ char *sequence = tgetstr (fcap, address);
+ if (sequence)
+ {
+ (void) sprintf (fkey, "f%d", i);
+ Fdefine_key (Vfunction_key_map,
+ build_string (sequence),
+ Fmake_vector (make_number (1), intern (fkey)));
+ }
+ }
}
}
@@ -1305,11 +1308,15 @@ term_get_fkeys (address)
* Various mappings to try and get a better fit.
*/
{
-#define CONDITIONAL_REASSIGN(cap1, cap2, sym) \
- if (!tgetstr (cap1, address) && tgetstr (cap2, address)) \
- Fdefine_key (Vfunction_key_map, \
- build_string (cap2), \
- Fmake_vector (make_number (1), intern (sym)))
+#define CONDITIONAL_REASSIGN(cap1, cap2, sym) \
+ if (!tgetstr (cap1, address)) \
+ { \
+ char *sequence = tgetstr (cap2, address); \
+ if (sequence) \
+ Fdefine_key (Vfunction_key_map, \
+ build_string (sequence), \
+ Fmake_vector (make_number (1), intern (sym))); \
+ }
/* if there's no key_next keycap, map key_npage to `next' keysym */
CONDITIONAL_REASSIGN ("%5", "kN", "next");