Skip to contentSkip to conversation

dosemu-1.1.3 and Cyrillic_er

DISCUSSION Stas Sergeev 2 participants 2 messages Apr 25, 2002 – Apr 26, 2002

lore
Share & tools
lore
#0 lore raw

Hello.

Quoted 2 lines · Sergey Suleymanov

Stas> altgr table is enough.
Actually only these are needed at all. ;)

But in fact this means that the problem is still there.
The problem is that normally altgr map is similar to the alt map, so the special keycodes in it are mapped as for the alt map.
But you are reserving altgr map for Cyrillic, so it must be treated as a plain map.
And for the plain map, the BackSpace keycode gets altered back to 8, see init_misc_plain_map() and init_misc_shifted_map().
So I think that the real fix would be something like the attached patch.

Quoted 2 lines

Stas> Does this help? Why 127 is there?
I presume this is ^?. Anyway, ^H also works. Thanks.

Actually I think it is a bios keycodes, so it must be 8. Which is done with the attached patch and no need to modify the keymaps at all. This patch also fixes some other small problems with ctrl and alt modifiers in cyrillic mode.
Does this look like a correct fix to you? And of course the root of the problem seems to be that dosemu currently doesn't natively support the layout switching.

plugin/kbd_unicode/serv_xlat.c +5 -4
@@ -361,11 +361,11 @@
 }
 static void init_misc_altgr_map(t_keysym *rule)
 {
-	rule[NUM_SPACE] = KEY_SPACE;
+	init_misc_plain_map(rule);
 }
 static void init_misc_shift_altgr_map(t_keysym *rule)
 {
-	rule[NUM_SPACE] = KEY_SPACE;
+	init_misc_shifted_map(rule);
 }
 static void init_misc_ctrl_alt_map(t_keysym *rule)
 {
@@ -1134,10 +1134,11 @@
 	if ((shiftstate & ANY_ALT) && (shiftstate & ANY_CTRL)) {
 		ch = state->rules->map.ctrl_alt[key];
 	}
-  else if ((shiftstate & (R_ALT|ALTGR_LOCK)) && (shiftstate & ANY_SHIFT)) {
+	else if ((shiftstate & ALTGR_LOCK) && (shiftstate & ANY_SHIFT) &&
+	    !(shiftstate & (ANY_CTRL | ANY_ALT))) {
 		ch = state->rules->map.shift_altgr[key];
 	}
-  else if (shiftstate & (R_ALT|ALTGR_LOCK)) {
+	else if ((shiftstate & ALTGR_LOCK) && !(shiftstate & (ANY_CTRL | ANY_ALT))) {
 		ch = state->rules->map.altgr[key];
 	}
 	else if (shiftstate & ANY_ALT) {
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Stas Sergeev writes:

Stas> But in fact this means that the problem is still there. The Stas> problem is that normally altgr map is similar to the alt map, Stas> so the special keycodes in it are mapped as for the alt map. Stas> But you are reserving altgr map for Cyrillic, so it must be Stas> treated as a plain map.

Maybe having separate keymaps would be more correctly. As for non-unicode keymaps.

Stas> This patch also fixes some other small problems with ctrl and Stas> alt modifiers in cyrillic mode.

I think this is needed too.

serv_xlat.c Fri Apr 26 15:12:22 2002 renamed from serv_xlat.c.orig Fri Apr 26 14:58:38 2002 +2 -2
@@ -705,8 +705,8 @@
        init_charset_keymap(charset, map->shift, MODIFIER_SHIFT); 
        init_charset_keymap(charset, map->ctrl, MODIFIER_CTRL);
        init_charset_keymap(charset, map->alt, MODIFIER_ALT);
-       init_charset_keymap(charset, map->altgr, MODIFIER_ALTGR);
-       init_charset_keymap(charset, map->shift_altgr, MODIFIER_SHIFT | MODIFIER_ALTGR);
+       init_charset_keymap(charset, map->altgr, 0);
+       init_charset_keymap(charset, map->shift_altgr, MODIFIER_SHIFT);
        init_charset_keymap(charset, map->ctrl_alt, MODIFIER_CTRL | MODIFIER_ALT);
 
        or better this
serv_xlat.c Fri Apr 26 15:12:22 2002 renamed from serv_xlat.c.orig Fri Apr 26 14:58:38 2002 +1 -1
@@ -1707,7 +1709,7 @@
        struct key_pressed_state *keys = &state->keys_pressed;
 
        /* altgr implies alt */
-       if (desired & MODIFIER_ALTGR)   desired |= MODIFIER_ALT;
+//     if (desired & MODIFIER_ALTGR)   desired |= MODIFIER_ALT;
 
        /* To keep some bits constant copy them from state->shiftstate into 
         * desired.

Stas> Does this look like a correct fix to you?

Quite correct I think.

Stas> And of course the root of the problem seems to be that dosemu Stas> currently doesn't natively support the layout switching.

Signature · 1 line
  Sergey Suleymanov