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
Closed

OCaml Graphics bug with Key_pressed and Poll #7194

vicuna opened this issue Mar 24, 2016 · 3 comments

Comments

@vicuna
Copy link

vicuna 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
Copy link
Author

vicuna 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
Copy link
Author

vicuna 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
Copy link
Author

vicuna commented Feb 17, 2017

Comment author: @xavierleroy

Clarified the documentation. Release 4.05.

@vicuna vicuna closed this as completed Feb 17, 2017
@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
Projects
None yet
Development

No branches or pull requests

1 participant