Open chriscamacho opened 8 months ago
As far as I remember the modifiers are all bit fields. You can use bitwise operators to do checks like this.
No only if another key is down, at least with pyglet and Linux
On Wednesday 21 February 2024, Einar Forselv @.***> wrote:
As far as I remember the modifiers are all bit fields. You can use bitwise operators to do checks like this.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.< https://ci4.googleusercontent.com/proxy/m_8ZbNc9O6NHqbv2OZ4HIwh5MuBFFXKj9NUohJY1J_jnT2E0kbT5HX-pYrLC6-Co9QR5dW4yVYXG8Ithdfo8fi94jhMIuIPiqEGhJyRVhVbnWitBTPUGvrWzFHAMhGg7JSZRyNCw0sDzlzqQYvZY6dJcP25wdYSZl-HifcWIo17rI4XDk3d63YP9We-fsxX4L25QqyAzjftsjVGj4PN6KyJ9G34Nxh6_0tjFKCddipG1jIsxtw=s0-d-e1-ft#https://github.com/notifications/beacon/AAFO4SOHSD456YCTJ3TNA33YUVKE7A5CNFSM6AAAAABDKV6T5SWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTUSJHAE.gif>Message ID: @.***>
--
blog bedroomcoders.co.uk http://bedroomcoders.co.uk Free source code and tutorials!
Disclaimer: By sending an email to ANY of my addresses you are agreeing that:
I am by definition, "the intended recipient"
All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. In particular, I may quote it where I please.
I may take the contents as representing the views of your company.
This overrides any disclaimer or statement of confidentiality that may be included on your message.
I ran into this problem too.
The magic number you're seeing comes from pyglet's keys.py: https://github.com/pyglet/pyglet/blob/master/pyglet/window/key.py#L297 \ The constants in wnd.keys come from moderngl_window/context/pyglet/keys.py in that case, which doesn't forward shift as a standalone key from pyglet's key module.
It'd be fairly straightforward to add that (and I think I'll send a PR soon), but the the issue is that we'd have to do it for all platforms.
can't find in self.wnd.keys a code for just these keys on their own
I'm concerned if some other backend is in use then these magic numbers will not hold...