openplanet-nl / issues

Issue tracker for Openplanet.
10 stars 0 forks source link

Some mouse/keyboard events not captured #30

Closed Phlarx closed 2 years ago

Phlarx commented 2 years ago

I noticed a few actions do not trigger a callback (e.g. OnKeyPress):

Unknown if these are limitations of Openplanet, Nadeo, imgui, or something else.

codecat commented 2 years ago

I've fixed this for the next update.

For Alt, you are looking for VirtualKey::Menu (VK_MENU).

The new callback signature for mousewheel events is:

bool OnMouseWheel(int x, int y)

I guess technically I could change the int to an enum, but that's for a later refactor. For now, you can safely assume that the button numbers will never change:

Note that currently any additional mouse buttons are not supported.. open another Github issue for that if you need it!

Phlarx commented 2 years ago

Are the x and y parameters to bool OnMouseWheel(int x, int y) the scroll input value or the mouse position?

codecat commented 2 years ago

It's the scroll delta in a direction, x being horizontal and y vertical. It's in segments of 120 (or less, when using smooth scrolling via eg. an Apple Magic Trackpad.