Fix ncurses input key codes

This commit is contained in:
Alexandre Bury 2017-08-23 09:59:54 -07:00
parent b5b9aa2f91
commit a1737ca0ba

View File

@ -185,66 +185,65 @@ fn parse_ncurses_char(ch: i32) -> Event {
// Values 512 and above are probably extensions // Values 512 and above are probably extensions
// Those keys don't seem to be documented... // Those keys don't seem to be documented...
519 => Event::Alt(Key::Del), 520 => Event::Alt(Key::Del),
520 => Event::AltShift(Key::Del), 521 => Event::AltShift(Key::Del),
521 => Event::Ctrl(Key::Del), 522 => Event::Ctrl(Key::Del),
522 => Event::CtrlShift(Key::Del), 523 => Event::CtrlShift(Key::Del),
// 523: CtrlAltDel?
// //
// 524? // 524?
525 => Event::Alt(Key::Down), 526 => Event::Alt(Key::Down),
526 => Event::AltShift(Key::Down), 527 => Event::AltShift(Key::Down),
527 => Event::Ctrl(Key::Down), 528 => Event::Ctrl(Key::Down),
528 => Event::CtrlShift(Key::Down), 529 => Event::CtrlShift(Key::Down),
529 => Event::CtrlAlt(Key::Down), 530 => Event::CtrlAlt(Key::Down),
530 => Event::Alt(Key::End), 531 => Event::Alt(Key::End),
531 => Event::AltShift(Key::End), 532 => Event::AltShift(Key::End),
532 => Event::Ctrl(Key::End), 533 => Event::Ctrl(Key::End),
533 => Event::CtrlShift(Key::End), 534 => Event::CtrlShift(Key::End),
534 => Event::CtrlAlt(Key::End), 535 => Event::CtrlAlt(Key::End),
535 => Event::Alt(Key::Home), 536 => Event::Alt(Key::Home),
536 => Event::AltShift(Key::Home), 537 => Event::AltShift(Key::Home),
537 => Event::Ctrl(Key::Home), 538 => Event::Ctrl(Key::Home),
538 => Event::CtrlShift(Key::Home), 539 => Event::CtrlShift(Key::Home),
539 => Event::CtrlAlt(Key::Home), 540 => Event::CtrlAlt(Key::Home),
540 => Event::Alt(Key::Ins), 541 => Event::Alt(Key::Ins),
// 541: AltShiftIns? 542 => Event::AltShift(Key::Ins),
542 => Event::Ctrl(Key::Ins), 543 => Event::Ctrl(Key::Ins),
// 543: CtrlShiftIns? // 544: CtrlShiftIns?
544 => Event::CtrlAlt(Key::Ins), 545 => Event::CtrlAlt(Key::Ins),
545 => Event::Alt(Key::Left), 546 => Event::Alt(Key::Left),
546 => Event::AltShift(Key::Left), 547 => Event::AltShift(Key::Left),
547 => Event::Ctrl(Key::Left), 548 => Event::Ctrl(Key::Left),
548 => Event::CtrlShift(Key::Left), 549 => Event::CtrlShift(Key::Left),
549 => Event::CtrlAlt(Key::Left), 550 => Event::CtrlAlt(Key::Left),
550 => Event::Alt(Key::PageDown), 551 => Event::Alt(Key::PageDown),
551 => Event::AltShift(Key::PageDown), 552 => Event::AltShift(Key::PageDown),
552 => Event::Ctrl(Key::PageDown), 553 => Event::Ctrl(Key::PageDown),
553 => Event::CtrlShift(Key::PageDown), 554 => Event::CtrlShift(Key::PageDown),
554 => Event::CtrlAlt(Key::PageDown), 555 => Event::CtrlAlt(Key::PageDown),
555 => Event::Alt(Key::PageUp), 556 => Event::Alt(Key::PageUp),
556 => Event::AltShift(Key::PageUp), 557 => Event::AltShift(Key::PageUp),
557 => Event::Ctrl(Key::PageUp), 558 => Event::Ctrl(Key::PageUp),
558 => Event::CtrlShift(Key::PageUp), 559 => Event::CtrlShift(Key::PageUp),
559 => Event::CtrlAlt(Key::PageUp), 560 => Event::CtrlAlt(Key::PageUp),
560 => Event::Alt(Key::Right), 561 => Event::Alt(Key::Right),
561 => Event::AltShift(Key::Right), 562 => Event::AltShift(Key::Right),
562 => Event::Ctrl(Key::Right), 563 => Event::Ctrl(Key::Right),
563 => Event::CtrlShift(Key::Right), 564 => Event::CtrlShift(Key::Right),
564 => Event::CtrlAlt(Key::Right), 565 => Event::CtrlAlt(Key::Right),
// 565? // 566?
566 => Event::Alt(Key::Up), 567 => Event::Alt(Key::Up),
567 => Event::AltShift(Key::Up), 568 => Event::AltShift(Key::Up),
568 => Event::Ctrl(Key::Up), 569 => Event::Ctrl(Key::Up),
569 => Event::CtrlShift(Key::Up), 570 => Event::CtrlShift(Key::Up),
570 => Event::CtrlAlt(Key::Up), 571 => Event::CtrlAlt(Key::Up),
ncurses::KEY_B2 => Event::Key(Key::NumpadCenter), ncurses::KEY_B2 => Event::Key(Key::NumpadCenter),
ncurses::KEY_DC => Event::Key(Key::Del), ncurses::KEY_DC => Event::Key(Key::Del),