diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-06-21 23:23:57 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-06-21 23:27:54 -0700 |
commit | 45c08fea47de1a23ce98f4fc7a1c5c3bed92b5fb (patch) | |
tree | 78cbc5db454f79c6baf91afa49f090cf8cb14a58 /077mouse.cc | |
parent | e552479afac60bdf3f5c089213cbc6422902ee5a (diff) | |
download | mu-45c08fea47de1a23ce98f4fc7a1c5c3bed92b5fb.tar.gz |
1616 - merging keyboard and events into 'console'
Only core layers currently passing. Console apps are probably still broken.
Diffstat (limited to '077mouse.cc')
-rw-r--r-- | 077mouse.cc | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/077mouse.cc b/077mouse.cc deleted file mode 100644 index 124e8db2..00000000 --- a/077mouse.cc +++ /dev/null @@ -1,39 +0,0 @@ -:(before "End Primitive Recipe Declarations") -READ_KEYBOARD_OR_MOUSE_EVENT, -:(before "End Primitive Recipe Numbers") -Recipe_number["read-keyboard-or-mouse-event"] = READ_KEYBOARD_OR_MOUSE_EVENT; -:(before "End Primitive Recipe Implementations") -case READ_KEYBOARD_OR_MOUSE_EVENT: { - products.resize(2); // result and status - tb_event event; - int event_type = tb_peek_event(&event, 5/*ms*/); - if (event_type == TB_EVENT_KEY) { - products.at(0).push_back(/*keyboard event*/0); - long long key = event.key ? event.key : event.ch; - if (key == TB_KEY_CTRL_C) tb_shutdown(), exit(1); - if (key == TB_KEY_BACKSPACE2) key = TB_KEY_BACKSPACE; - if (key == TB_KEY_CARRIAGE_RETURN) key = TB_KEY_NEWLINE; - products.at(0).push_back(key); - products.at(0).push_back(0); - products.at(0).push_back(0); - products.at(1).push_back(/*found*/true); - break; - } - if (event_type == TB_EVENT_MOUSE) { - products.at(0).push_back(/*mouse event*/1); -//? tb_shutdown(); //? 1 -//? cerr << event_type << ' ' << event.key << ' ' << event.y << ' ' << event.x << '\n'; //? 1 -//? exit(0); //? 1 - products.at(0).push_back(event.key); // which button, etc. - products.at(0).push_back(event.y); // row - products.at(0).push_back(event.x); // column - products.at(1).push_back(/*found*/true); - break; - } - products.at(0).push_back(0); - products.at(0).push_back(0); - products.at(0).push_back(0); - products.at(0).push_back(0); - products.at(1).push_back(/*found*/false); - break; -} |