ciaa-nxp/modpybkeyboard.c
// get_char method : waits until a key is pressed and returns it
get_char method : waits until a key is pressed and returns it
get_char method : waits until a key is pressed and returns it
mp_obj_t pyb_keyboard_get_char(mp_obj_t self_in) {
    pyb_keyboard_obj_t *self = self_in;
    uint8_t key=0xFF;
    while(key==0xFF)
	key = pyb_keyboard_getKey(self);
    uint8_t key2=key;
    while(key2!=0xFF)
	key2 = pyb_keyboard_getKey(self);
    mp_hal_milli_delay(1);
    return MP_OBJ_NEW_SMALL_INT(key);
}
mp_obj_t pyb_keyboard_get_char ( mp_obj_t self_in ) { pyb_keyboard_obj_t * self = self_in ; uint8_t key = 0xFF ; while ( key == 0xFF ) key = pyb_keyboard_getKey ( self ) ; uint8_t key2 = key ; while ( key2 != 0xFF ) key2 = pyb_keyboard_getKey ( self ) ; mp_hal_milli_delay ( 1 ) ; return MP_OBJ_NEW_SMALL_INT ( key ) ; }
get_char method : waits until a key is pressed and returns it
get_char method : waits until a key is pressed and returns it
// wait key press // wait key relese