tjammer / raylib-ocaml

OCaml bindings for raylib and raygui
https://tjammer.github.io/raylib-ocaml/
MIT License
173 stars 14 forks source link

[Bug] get_char_pressed wrong return type #34

Closed Mia75owo closed 1 year ago

Mia75owo commented 1 year ago

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)
tjammer commented 1 year ago

Thanks for catching this!

Should be fixed with 2bf104436969c2820fff9bb426aa640378053a90