indianakernick / The-Fat-Controller

A library for simulating mouse and keyboard events
Apache License 2.0
39 stars 17 forks source link

no support for Insert key on Linux? #10

Closed idun-project closed 8 months ago

idun-project commented 8 months ago

Howdy. I don't see any "Key::Insert" enum entry or use of "KEY_INSERT". Is there a reason it is not supported?

indianakernick commented 8 months ago

There's no particular reason for it not being supported. I guess it seemed a bit obscure at the time. While I'm at it, are there any other missing keys?

BrianHoldsworth commented 8 months ago

Ok, good to know. Some other "common" keys that might be useful to someone and don't seem to be included are: KEY_NUMLOCK, KEY_SCROLLLOCK, KEY_SYSRQ, KEY_MENU

indianakernick commented 8 months ago

Ah, I think I know why it wasn't included. There isn't an insert key on macOS. So if Key::Insert was added, we have that edge-case to deal with on macOS.

I think the Key enum should be as platform-independent as possible. When it comes to keys that are not supported by some operating systems, it seems to me that it might be better to have a function that takes a platform-specific key code. That seems like a pain to use though. Especially since Windows and Linux both have an insert key but they obviously won't use the same key code.

Maybe having Key::Insert simply do nothing on macOS is the way to go. I might need to give this some thought.

indianakernick commented 8 months ago

I added Key::Insert shortly after I wrote my previous comment. I didn't add the others because they're not supported by all platforms. I'll add them if someone says that they need them but to me they seem too obscure to be added just-in-case.

I saw your comment on the other issue. Can you confirm that this solves your problem so that I can publish a new release?

BrianHoldsworth commented 8 months ago

Yes, I confirmed your changes and all good to go for me. Thanks again!

indianakernick commented 8 months ago

Closing as resolved since version 0.7.0 has been published.