You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1735 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Windows XP, ocaml 3.06, graphics library
Compile and run the following program as (graphics > out), then click and
hold the mouse button in the window, then hit esc, then look in out. You
will see the first event having the mouse button down, and then a bunch of
button:false's, and then button:trues again. It looks like the first 200
or so Poll'ed button reads after a mouse down return false even though the
button is still down, and then it starts returning true again. If you're
always just polling (set dopoll=true) then the reading is correct always.
Original bug ID: 1735
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Windows XP, ocaml 3.06, graphics library
Compile and run the following program as (graphics > out), then click and
hold the mouse button in the window, then hit esc, then look in out. You
will see the first event having the mouse button down, and then a bunch of
button:false's, and then button:trues again. It looks like the first 200
or so Poll'ed button reads after a mouse down return false even though the
button is still down, and then it starts returning true again. If you're
always just polling (set dopoll=true) then the reading is correct always.
Chris
(* ocamlc -o graphics.exe unix.cma graphics.cma graphtest.ml *)
open Graphics
let print_event e =
Printf.printf "x:%d y:%d button:%b keypressed:%b key:%c\n" e.mouse_x
e.mouse_y e.button e.keypressed e.key;
flush stdout
let _ =
open_graph "";
set_color white;
clear_graph ();
set_color black;
plot 50 50;
let quit = ref false in
let dopoll = ref false in
while not !quit do
let e = wait_next_event (if !dopoll then [Poll] else [Button_down;
Key_pressed]) in
dopoll := true;
print_event e;
match e.key with
'q' | '\027' -> quit := true
| 'p' -> dopoll := false
| _ -> ()
done;
close_graph ();
()
The text was updated successfully, but these errors were encountered: