tjammer/raylib-ocaml

[Bug] get_char_pressed wrong return type

Closed this issue · 1 comments

The function get_char_pressed in src/c/functions/raylib_functions.ml returns the Key.t type instead of an unicode char.

GetKeyPressed returns a keycode (correct)
GetCharPressed returns an unicode char (wrong in the ocaml code)

int GetKeyPressed(void);
// Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
int GetCharPressed(void);
// Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty
let get_key_pressed = foreign "GetKeyPressed" (void @-> returning Key.t)
let get_char_pressed = foreign "GetCharPressed" (void @-> returning Key.t)

Thanks for catching this!

Should be fixed with 2bf1044