~lucasemmoreira/janet-ncurses

645c9dc9e9f245eb129589b0862a69379219bc05 — Lucas Moreira 2 years ago 0e5ac54
Fix: up and down driver
2 files changed, 3 insertions(+), 3 deletions(-)

M janet-ncurses.c
M test/menu.janet
M janet-ncurses.c => janet-ncurses.c +1 -1
@@ 111,7 111,7 @@ static Janet jKEY_DOWN(int32_t argc, Janet *argv){

static Janet jKEY_UP(int32_t argc, Janet *argv){
  janet_fixarity(argc, 0);
  return janet_wrap_integer(KEY_DOWN);
  return janet_wrap_integer(KEY_UP);
}



M test/menu.janet => test/menu.janet +2 -2
@@ 19,8 19,8 @@
(nc/refresh)

(while true
  (let [c (nc/getch)
        _ (print "char " c " and value " (nc/KEY_UP))]
  (let [c (nc/getch)]
    (nc/mvwprintw (nc/stdscr) 5 1 (string c (nc/KEY_DOWN) (nc/KEY_UP)))
    (case c 
      (nc/KEY_DOWN) (nc/menu_driver menu (nc/REQ_DOWN_ITEM))
      (nc/KEY_UP) (nc/menu_driver menu (nc/REQ_UP_ITEM)))))