Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCaml Graphics bug with Key_pressed and Poll #7194

Closed
vicuna opened this Issue Mar 24, 2016 · 3 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

commented Mar 24, 2016

Original bug ID: 7194
Reporter: MonsieurPi
Status: resolved (set by @xavierleroy on 2017-02-17T15:02:14Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.3
Target version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: otherlibs

Bug description

If you put wait_next_event[Key_pressed; Poll; ...] and press a key, this key will never be dequeued although it's specifically written in the documentation :

val wait_next_event : event list -> status

Wait until one of the events specified in the given event list occurs, and return the status of the mouse and keyboard at that time. If Poll is given in the event list, return immediately with the current status. Keypresses are queued, and dequeued one by one when the Key_pressed event is specified.

I attached a test file.

File attachments

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 24, 2016

Comment author: @damiendoligez

The documentation should be clearer, but this works as intended: the clause

If Poll is given in the event list, return immediately with the current status.
takes precedence over the other two sentences.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 25, 2016

Comment author: MonsieurPi

Yes, I didn't know if I had to put it as a documentation problem or an otherlib one. ;-)

I understand why this is what was expected but, indead, it's not clear from the documentation.

Thanks

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 17, 2017

Comment author: @xavierleroy

Clarified the documentation. Release 4.05.

@vicuna vicuna closed this Feb 17, 2017

@vicuna vicuna added the otherlibs label Mar 14, 2019

@vicuna vicuna added this to the 4.05.0 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.