convertIntToDirectInputKeys static method
Converts an integer value to a list of corresponding direct input key codes.
The method takes an integer value, converts it to its string representation, and then maps each character to its respective DirectInputKey and key code. This is useful for generating commands based on numeric input.
Example:
List<String> keys = DirectInputKeysHelper.convertIntToDirectInputKeys(123);
// Returns ['Q1', 'Q2', 'Q3']
value
is the integer value to be converted to a list of direct input key codes.
Implementation
static List<String> convertIntToDirectInputKeys(int value) {
final text = value.toString();
final keys = text
.split('')
.map((c) => charToDirectInputKey[c]!)
.map((key) => directInputKeyCodes[key]!)
.toList();
return keys;
}