Left: | ||
Right: |
LEFT | RIGHT |
---|---|
(no file at all) | |
1 /* | 1 /* |
2 * Window system protocol server. | 2 * Window system protocol server. |
3 */ | 3 */ |
4 | 4 |
5 #include <u.h> | 5 #include <u.h> |
6 #include <libc.h> | 6 #include <libc.h> |
7 #include "cocoa-thread.h" | 7 #include "cocoa-thread.h" |
8 #include <draw.h> | 8 #include <draw.h> |
9 #include <memdraw.h> | 9 #include <memdraw.h> |
10 #include <keyboard.h> | 10 #include <keyboard.h> |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
360 | 360 |
361 static int alting; | 361 static int alting; |
362 | 362 |
363 void | 363 void |
364 abortcompose(void) | 364 abortcompose(void) |
365 { | 365 { |
366 if(alting) | 366 if(alting) |
367 keystroke(Kalt); | 367 keystroke(Kalt); |
368 } | 368 } |
369 | 369 |
370 void resizeimg(void); | |
371 | |
370 void | 372 void |
371 keystroke(int c) | 373 keystroke(int c) |
372 { | 374 { |
373 static Rune k[10]; | 375 static Rune k[10]; |
374 static int nk; | 376 static int nk; |
375 int i; | 377 int i; |
376 | 378 |
377 if(c == Kalt){ | 379 if(c == Kalt){ |
378 alting = !alting; | 380 alting = !alting; |
379 nk = 0; | 381 nk = 0; |
382 return; | |
383 } | |
384 if(c == KF+3) { | |
385 if(forcedpi) | |
386 forcedpi = 0; | |
387 else if(displaydpi >= 200) | |
388 forcedpi = 100; | |
389 else | |
390 forcedpi = 225; | |
391 resizeimg(); | |
380 return; | 392 return; |
381 } | 393 } |
382 if(!alting){ | 394 if(!alting){ |
383 kputc(c); | 395 kputc(c); |
384 return; | 396 return; |
385 } | 397 } |
386 if(nk >= nelem(k)) // should not happen | 398 if(nk >= nelem(k)) // should not happen |
387 nk = 0; | 399 nk = 0; |
388 k[nk++] = c; | 400 k[nk++] = c; |
389 c = _latin1(k, nk); | 401 c = _latin1(k, nk); |
390 if(c > 0){ | 402 if(c > 0){ |
391 alting = 0; | 403 alting = 0; |
392 kputc(c); | 404 kputc(c); |
393 nk = 0; | 405 nk = 0; |
394 return; | 406 return; |
395 } | 407 } |
396 if(c == -1){ | 408 if(c == -1){ |
397 alting = 0; | 409 alting = 0; |
398 for(i=0; i<nk; i++) | 410 for(i=0; i<nk; i++) |
399 kputc(k[i]); | 411 kputc(k[i]); |
400 nk = 0; | 412 nk = 0; |
401 return; | 413 return; |
402 } | 414 } |
403 // need more input | 415 // need more input |
404 return; | 416 return; |
405 } | 417 } |
LEFT | RIGHT |