mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
14 lines
356 B
C++
14 lines
356 B
C++
extern "C" {
|
|
#include "modion.h"
|
|
#include <py/objtuple.h>
|
|
#include <py/runtime.h>
|
|
}
|
|
#include <ion.h>
|
|
#include "port.h"
|
|
|
|
mp_obj_t modion_keyboard_keydown(mp_obj_t key_o) {
|
|
Ion::Keyboard::Key key = static_cast<Ion::Keyboard::Key>(mp_obj_get_int(key_o));
|
|
Ion::Keyboard::State state = Ion::Keyboard::scan();
|
|
return mp_obj_new_bool(state.keyDown(key));
|
|
}
|