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

Mouse and keyboard issues #298

Open
univrsal opened this issue Dec 6, 2022 · 7 comments
Open

Mouse and keyboard issues #298

univrsal opened this issue Dec 6, 2022 · 7 comments

Comments

@univrsal
Copy link
Owner

univrsal commented Dec 6, 2022

This issue accumulates all issues with mouse and keyboard buttons/mappings.

#247
Apparently an issue with the preset (fixed in #100)

#266
Side mouse button swapped (These mapping issues might not be really fixable as "swapped" for one person could be the correct order for others and therefore a separate layout with swapped side buttons would probably just be better)

#209
Tilde key not registering on uk qwerty. This was on v4.8 so maybe the new uiohook version already fixed this.
#216
Tilde key not working on us qwerty.

#201
ü, ö, ä not working (io-cct probably not returning the correct keycodes

#180
Right mouse button and middle mouse button swapped

#174
Arrow keys issue as well as numpad/function keys (delete, insert etc.) (Related PR for libuiohook)

#187
Tilde, left super/meta/windows key, side mouse buttons

Just like with the gamepad issues, I'll close the individual issues and use this one to track their progress

These issues leave the following keys/buttons to test:

  • Tilde (us and uk qwerty), Left Super/Meta/Windows key,
  • Side mouse buttons (swapped)
  • Middle mouse button and right mouse button swapped
@clarfonthey
Copy link

Gonna add this here but also not expect it to be fixed until after the SDL work: Wayland interacts a bit differently than X does on Linux, and so there may need to be some additional work to explicitly request focus of the keyboard/mouse to get that working under Wayland. While controller input works fine for me, keyboard/mouse doesn't under the existing plugin, and I'd imagine the new work will need some changes as well.

Happy to help test this out and probably figure out what weird code changes are necessary to make it work.

@univrsal
Copy link
Owner Author

univrsal commented Dec 7, 2022

Gonna add this here but also not expect it to be fixed until after the SDL work: Wayland interacts a bit differently than X does on Linux, and so there may need to be some additional work to explicitly request focus of the keyboard/mouse to get that working under Wayland. While controller input works fine for me, keyboard/mouse doesn't under the existing plugin, and I'd imagine the new work will need some changes as well.

Happy to help test this out and probably figure out what weird code changes are necessary to make it work.

Input hooking is done through libuiohook, Wayland support is tracked here kwhat/libuiohook#100, but that doesn't really matter as Wayland doesn't really support global input hooking last time I checked.

@clarfonthey
Copy link

Yeah, Wayland doesn't support global input hooks, but I believe that with something like OBS you can kind of hack it in by letting both windows have focus. Either way, I was planning to take a look myself to see what I can do for it since it's not really a standard use case.

@000exploit
Copy link

as Wayland doesn't really support global input hooking

And it won't have it by design. Some features, such as global shortcuts, can only be implemented through portals as a universal method for a sandbox-compatible and safe solution or in specific libraries, i.e. wlroots.

@Svarr
Copy link

Svarr commented Feb 13, 2023

Probably related to #174 is io-cct returning 0x0 as the keycode for VC_KP_DIVIDE. Manually setting it to the correct value (0x0E35) works in OBS.

Another issue I encountered is that in io-cct the mouse wheel scroll directions are reversed. The description of the element lists them in the correct order (up then down). In OBS they are recognised properly.

Lastly, still regarding the mouse wheel, it appears that there is currently no differentiation between vertical and horizontal scrolling. I only use the mouse wheel element in the preset and haven't set anything up for horizontal scrolling (as I'm not using it in the game). In OBS, scrolling right triggers the visuals for scrolling down and scrolling left the visuals for scrolling up, while in io-cct both are recognised as scrolling down.

@e9x
Copy link

e9x commented Apr 28, 2023

I propose the following for #180:

Add a setting to swap middle mouse and right mouse button.

It would go here, before any logic/dispatching:

if (event->type == EVENT_MOUSE_CLICKED || event->type == EVENT_MOUSE_PRESSED ||
    event->type == EVENT_MOUSE_RELEASED) {
    if (event->data.mouse.button == 2)
        event->data.mouse.button = 3;
    else if (event->data.mouse.button == 3)
        event->data.mouse.button = 2;
}

Maybe there's a more appropriate place to switch the buttons, like the JavaScript.

@univrsal
Copy link
Owner Author

inline uint16_t mouse_fix(int m)
{
#ifndef _WIN32 /* Linux mixes right mouse and middle mouse or is windows getting it wrong? */
if (m == 3)
m = 2;
else if (m == 2)
m = 3;
#endif
return m;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants