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
10801080 kbdproc(void *cchan)
10811081 {
10821082 char buf[128], buf2[128], *s;
1083− int kfd, n;
1083+ int kfd, n, kbin;
10841084 Rune r;
10851085
10861086 threadsetname("kbdproc");
10871087 if ((kfd = open("/dev/kbd", OREAD)) < 0)
10881088 sysfatal("/dev/kbd: %r");
1089+ kbin = open("/dev/kbin", OWRITE);
10891090
10901091 buf2[0] = 0;
10911092 buf2[1] = 0;
@@ -1116,6 +1117,9 @@ kbdproc(void *cchan) · 24 unmodified lines
11161117 s += chartorune(&r, s);
11171118 if (utfrune(buf2+1, r) == nil) {
11181119 if (r == Kalt) {
1120+ /* magic trick: write Alt scancode to disable the "compose" mode */
1121+ if (kbin >= 0)
1122+ write(kbin, "\x46", 1);
11191123 altdown = true;
11201124 } else if (r == Kshift) {
11211125 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