this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

#2785: fixed key() api in python

+5 -5
+5 -5
src/api/python.c
··· 151 151 int rotate; 152 152 int w; 153 153 int h; 154 - char colors[16]; 154 + u8 colors[16]; 155 155 for (int i = 0; i < 9; i++) 156 156 PY_CHECK_ARG_TYPE(i, tp_int); 157 157 tic_core* core = get_core(); ··· 402 402 return ValueError("unknown keyboard input"); 403 403 } 404 404 405 - bool pressed = core->api.key(tic, code); 405 + bool pressed = core->api.key(tic, code == -1 ? tic_key_unknown : code); 406 406 py_newbool(py_retval(), pressed); 407 407 408 408 return true; ··· 426 426 return ValueError("unknown keyboard input"); 427 427 } 428 428 429 - bool pressed = core->api.keyp(tic, code, hold, period); 429 + bool pressed = core->api.keyp(tic, code == -1 ? tic_key_unknown : code, hold, period); 430 430 py_newbool(py_retval(), pressed); 431 431 432 432 return true; ··· 486 486 { 487 487 int x, y, w, h, sx, sy, colorkey, scale; 488 488 bool use_remap; 489 - char colors[16]; 489 + u8 colors[16]; 490 490 491 491 PY_CHECK_ARG_TYPE(0, tp_int); 492 492 PY_CHECK_ARG_TYPE(1, tp_int); ··· 972 972 double x1, y1, x2, y2, x3, y3, u1, v1, u2, v2, u3, v3; 973 973 int texsrc, chromakey; 974 974 double z1, z2, z3; 975 - char colors[16]; 975 + u8 colors[16]; 976 976 PY_CHECK_ARG_TYPE(12, tp_int); 977 977 if (py_istype(py_arg(13), tp_int) || py_istype(py_arg(13), tp_list)) 978 978 { //it's one of the types