From a1737ca0ba1a99bffc5ec6f42e3371c9df552a91 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Wed, 23 Aug 2017 09:59:54 -0700 Subject: [PATCH] Fix ncurses input key codes --- src/backend/curses/n.rs | 101 ++++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 51 deletions(-) diff --git a/src/backend/curses/n.rs b/src/backend/curses/n.rs index 780e73c..fc0e963 100644 --- a/src/backend/curses/n.rs +++ b/src/backend/curses/n.rs @@ -185,66 +185,65 @@ fn parse_ncurses_char(ch: i32) -> Event { // Values 512 and above are probably extensions // Those keys don't seem to be documented... - 519 => Event::Alt(Key::Del), - 520 => Event::AltShift(Key::Del), - 521 => Event::Ctrl(Key::Del), - 522 => Event::CtrlShift(Key::Del), - // 523: CtrlAltDel? + 520 => Event::Alt(Key::Del), + 521 => Event::AltShift(Key::Del), + 522 => Event::Ctrl(Key::Del), + 523 => Event::CtrlShift(Key::Del), // // 524? - 525 => Event::Alt(Key::Down), - 526 => Event::AltShift(Key::Down), - 527 => Event::Ctrl(Key::Down), - 528 => Event::CtrlShift(Key::Down), - 529 => Event::CtrlAlt(Key::Down), + 526 => Event::Alt(Key::Down), + 527 => Event::AltShift(Key::Down), + 528 => Event::Ctrl(Key::Down), + 529 => Event::CtrlShift(Key::Down), + 530 => Event::CtrlAlt(Key::Down), - 530 => Event::Alt(Key::End), - 531 => Event::AltShift(Key::End), - 532 => Event::Ctrl(Key::End), - 533 => Event::CtrlShift(Key::End), - 534 => Event::CtrlAlt(Key::End), + 531 => Event::Alt(Key::End), + 532 => Event::AltShift(Key::End), + 533 => Event::Ctrl(Key::End), + 534 => Event::CtrlShift(Key::End), + 535 => Event::CtrlAlt(Key::End), - 535 => Event::Alt(Key::Home), - 536 => Event::AltShift(Key::Home), - 537 => Event::Ctrl(Key::Home), - 538 => Event::CtrlShift(Key::Home), - 539 => Event::CtrlAlt(Key::Home), + 536 => Event::Alt(Key::Home), + 537 => Event::AltShift(Key::Home), + 538 => Event::Ctrl(Key::Home), + 539 => Event::CtrlShift(Key::Home), + 540 => Event::CtrlAlt(Key::Home), - 540 => Event::Alt(Key::Ins), - // 541: AltShiftIns? - 542 => Event::Ctrl(Key::Ins), - // 543: CtrlShiftIns? - 544 => Event::CtrlAlt(Key::Ins), + 541 => Event::Alt(Key::Ins), + 542 => Event::AltShift(Key::Ins), + 543 => Event::Ctrl(Key::Ins), + // 544: CtrlShiftIns? + 545 => Event::CtrlAlt(Key::Ins), - 545 => Event::Alt(Key::Left), - 546 => Event::AltShift(Key::Left), - 547 => Event::Ctrl(Key::Left), - 548 => Event::CtrlShift(Key::Left), - 549 => Event::CtrlAlt(Key::Left), + 546 => Event::Alt(Key::Left), + 547 => Event::AltShift(Key::Left), + 548 => Event::Ctrl(Key::Left), + 549 => Event::CtrlShift(Key::Left), + 550 => Event::CtrlAlt(Key::Left), - 550 => Event::Alt(Key::PageDown), - 551 => Event::AltShift(Key::PageDown), - 552 => Event::Ctrl(Key::PageDown), - 553 => Event::CtrlShift(Key::PageDown), - 554 => Event::CtrlAlt(Key::PageDown), + 551 => Event::Alt(Key::PageDown), + 552 => Event::AltShift(Key::PageDown), + 553 => Event::Ctrl(Key::PageDown), + 554 => Event::CtrlShift(Key::PageDown), + 555 => Event::CtrlAlt(Key::PageDown), - 555 => Event::Alt(Key::PageUp), - 556 => Event::AltShift(Key::PageUp), - 557 => Event::Ctrl(Key::PageUp), - 558 => Event::CtrlShift(Key::PageUp), - 559 => Event::CtrlAlt(Key::PageUp), + 556 => Event::Alt(Key::PageUp), + 557 => Event::AltShift(Key::PageUp), + 558 => Event::Ctrl(Key::PageUp), + 559 => Event::CtrlShift(Key::PageUp), + 560 => Event::CtrlAlt(Key::PageUp), - 560 => Event::Alt(Key::Right), - 561 => Event::AltShift(Key::Right), - 562 => Event::Ctrl(Key::Right), - 563 => Event::CtrlShift(Key::Right), - 564 => Event::CtrlAlt(Key::Right), - // 565? - 566 => Event::Alt(Key::Up), - 567 => Event::AltShift(Key::Up), - 568 => Event::Ctrl(Key::Up), - 569 => Event::CtrlShift(Key::Up), - 570 => Event::CtrlAlt(Key::Up), + 561 => Event::Alt(Key::Right), + 562 => Event::AltShift(Key::Right), + 563 => Event::Ctrl(Key::Right), + 564 => Event::CtrlShift(Key::Right), + 565 => Event::CtrlAlt(Key::Right), + // 566? + 567 => Event::Alt(Key::Up), + 568 => Event::AltShift(Key::Up), + 569 => Event::Ctrl(Key::Up), + 570 => Event::CtrlShift(Key::Up), + 571 => Event::CtrlAlt(Key::Up), ncurses::KEY_B2 => Event::Key(Key::NumpadCenter), ncurses::KEY_DC => Event::Key(Key::Del),