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: 2488 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Eijiro Sumii
Version: 3.06, 3.07, cvs
OS: Windows 2000, Windows XP
Submission from: pcp01330153pcs.chrstn01.pa.comcast.net (68.81.130.132)
It seems to me that polling in the Graphics library for Windows is
fundamentally broken (or very different from the X version, at least).
For example, if you do something like:
Graphics.open_graph "" ;;
while true do
let e = Graphics.wait_next_event [Graphics.Poll; Graphics.Key_pressed] in
if e.Graphics.keypressed then begin
Format.eprintf "event received@.";
if e.Graphics.keypressed then Format.eprintf "key pressed@.";
Format.eprintf "reading the event@.";
ignore (Graphics.wait_next_event [Graphics.Key_pressed]);
Format.eprintf "event read@."
end
done ;;
on Windows and X, then the behavior when a key is pressed for a second is
completely different. Looking at win32graph/draw.c
if (poll) {
// Poll uses info on last event stored in global variables
mouse_x = MouseLastX;
mouse_y = MouseLastY;
button = MouseLbuttonDown | MouseMbuttonDown |
MouseRbuttonDown;
key = LastKey;
}
else { // Not polled. Block for a message
and win32graph/open.c
case WM_CHAR:
LastKey = wParam & 0xFF;
break;
case WM_KEYUP:
LastKey = -1;
break;
the meaning of "key pressed" events seems completely different in Windows from
X. Since this difference is rather significant, it would better be fixed or at
least documented.
The text was updated successfully, but these errors were encountered:
Original bug ID: 2488
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Eijiro Sumii
Version: 3.06, 3.07, cvs
OS: Windows 2000, Windows XP
Submission from: pcp01330153pcs.chrstn01.pa.comcast.net (68.81.130.132)
It seems to me that polling in the Graphics library for Windows is
fundamentally broken (or very different from the X version, at least).
For example, if you do something like:
Graphics.open_graph "" ;;
while true do
let e = Graphics.wait_next_event [Graphics.Poll; Graphics.Key_pressed] in
if e.Graphics.keypressed then begin
Format.eprintf "event received@.";
if e.Graphics.keypressed then Format.eprintf "key pressed@.";
Format.eprintf "reading the event@.";
ignore (Graphics.wait_next_event [Graphics.Key_pressed]);
Format.eprintf "event read@."
end
done ;;
on Windows and X, then the behavior when a key is pressed for a second is
completely different. Looking at win32graph/draw.c
MouseRbuttonDown;
key = LastKey;
}
else { // Not polled. Block for a message
and win32graph/open.c
the meaning of "key pressed" events seems completely different in Windows from
X. Since this difference is rather significant, it would better be fixed or at
least documented.
The text was updated successfully, but these errors were encountered: