Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#11 keysym of bépo key % −> <unknown constructor>

open
nobody
General (5)
5
2013-01-05
2013-01-05
Cadé David
No

I am on a Debian machine with a self compiled ocamlsdl 0.9.1.

The event returned by Sdlevent.get when pressing the key % on a bépo keyboard is:
val e : Sdlevent.event =
Sdlevent.KEYDOWN
{Sdlevent.ke_which = 0; Sdlevent.ke_state = Sdlevent.PRESSED;
Sdlevent.keysym = <unknown constructor>; Sdlevent.keymod = 0;
Sdlevent.keycode = '\000'; Sdlevent.unicode = 0}

and Sdlkey.name, Sdlkey.int_of_key when given in argument this keysym raise the exception:
Invalid_argument "index out of bounds"

To reproduce the bug:

- compile this program that prints the names of the pressed keys:

let _ =
Sdl.init [ `EVERYTHING ];
let _ = Sdlvideo.set_video_mode 200 200 [] in
while true do
match Sdlevent.wait_event () with
| Sdlevent.KEYDOWN e ->
let k = e.Sdlevent.keysym in
Printf.printf "%s\n%!" (Sdlkey.name k)
| _ -> ()
done

- pass the keyboard in bépo with setxkbmap fr -variant bepo

- launch the program

- and finally press on the % key (the key = on azerty or qwerty keyboards)

Discussion