History

plan9: disable compose mode after Alt has been pressed

Sigrid Haflínudóttir committed 6 years ago

Commit 6101cdd1 parent e1530111 file · +5 −1Browse files

Unified · Split

plan9.c+5−1
@@ -1080,12 +1080,13 @@ static void · 1079 unmodified lines
1080kbdproc(void *cchan)1080kbdproc(void *cchan)
1081{1081{
1082 char buf[128], buf2[128], *s;1082 char buf[128], buf2[128], *s;
1083 int kfd, n;1083 int kfd, n, kbin;
1084 Rune r;1084 Rune r;
1085 1085
1086 threadsetname("kbdproc");1086 threadsetname("kbdproc");
1087 if ((kfd = open("/dev/kbd", OREAD)) < 0)1087 if ((kfd = open("/dev/kbd", OREAD)) < 0)
1088 sysfatal("/dev/kbd: %r");1088 sysfatal("/dev/kbd: %r");
1089 kbin = open("/dev/kbin", OWRITE);
1089 1090
1090 buf2[0] = 0;1091 buf2[0] = 0;
1091 buf2[1] = 0;1092 buf2[1] = 0;
@@ -1116,6 +1117,9 @@ kbdproc(void *cchan) · 24 unmodified lines
1116 s += chartorune(&r, s);1117 s += chartorune(&r, s);
1117 if (utfrune(buf2+1, r) == nil) {1118 if (utfrune(buf2+1, r) == nil) {
1118 if (r == Kalt) {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 altdown = true;1123 altdown = true;
1120 } else if (r == Kshift) {1124 } else if (r == Kshift) {
1121 shiftdown = true;1125 shiftdown = true;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t