Unified · Split
| @@ -1080,12 +1080,13 @@ static void · 1079 unmodified lines | ||
| 1080 | 1080 | kbdproc(void *cchan) |
| 1081 | 1081 | { |
| 1082 | 1082 | char buf[128], buf2[128], *s; |
| 1083 | − int kfd, n; | |
| 1083 | + int kfd, n, kbin; | |
| 1084 | 1084 | Rune r; |
| 1085 | 1085 | |
| 1086 | 1086 | threadsetname("kbdproc"); |
| 1087 | 1087 | if ((kfd = open("/dev/kbd", OREAD)) < 0) |
| 1088 | 1088 | sysfatal("/dev/kbd: %r"); |
| 1089 | + kbin = open("/dev/kbin", OWRITE); | |
| 1089 | 1090 | |
| 1090 | 1091 | buf2[0] = 0; |
| 1091 | 1092 | buf2[1] = 0; |
| @@ -1116,6 +1117,9 @@ kbdproc(void *cchan) · 24 unmodified lines | ||
| 1116 | 1117 | s += chartorune(&r, s); |
| 1117 | 1118 | if (utfrune(buf2+1, r) == nil) { |
| 1118 | 1119 | if (r == Kalt) { |
| 1120 | + /* magic trick: write Alt scancode to disable the "compose" mode */ | |
| 1121 | + if (kbin >= 0) | |
| 1122 | + write(kbin, "\x46", 1); | |
| 1119 | 1123 | altdown = true; |
| 1120 | 1124 | } else if (r == Kshift) { |
| 1121 | 1125 | shiftdown = true; |