Animeshz / keyboard-mouse-kt

A lightweight multiplatform library for interacting with global keyboard and mouse events and states from Kotlin, Java and NodeJS.
https://animeshz.github.io/keyboard-mouse-kt
MIT License
52 stars 2 forks source link

Feature: To add a flexible way to specify more than 1 key combination (KeySet) #5

Open Animeshz opened 3 years ago

Animeshz commented 3 years ago

Current implementation only allows to specify one KeySet when calling some function in the Keyboard.

But that's not really idiomatic, in sense that we may want to do something like (Key.LeftCtrl or Key.RightCtrl) + K combination, in this case we can add two different handler for that (or create a lambda in a variable and call the function twice), but in some parts like suspensive waiting for key combination(s) to be pressed it is quite cumbersome.

Similarly if we want something like (Key.LeftCtrl or Key.RightCtrl) + (Key.LeftShift or Key.RightShift) + G the code becomes multiplicative large (i.e. setting the handler 4 times).

So the issue is clear, to implement a flexible way to pass a generic KeyCombination which is different from KeySet and allows to interact with the high-level api in even more convenient way!