shoes3
shoes3 copied to clipboard
keypress doesn't handle non-modifier combination keys
Keypress currently handles keys and modifier combination keys well. It is possible to make all kind of combinations with ctrl/cmd, alt and shift or all of those together. Normal key combinations is however impossible to catch, such as pressing left and up key at the same time, or two or more letters.
Why should we care? Games sometimes require handling such key combinations.
Shoes.app {
keypress { |n| para n }
}
Perhaps some games may poll the native keyboard using the plaftorm API for raw keys. Shoes would need a very clever state machine (aka buggy and untestable for all situations and platforms). The best you can expect is to write your own with #383. Very difficult to do.
Perhaps some games may poll the native keyboard using the plaftorm API for raw keys.
That could work with raw keys. A poll with an iterator, e.g. next. It would certainly prevent losing keys.
The best you can expect is to write your own with #383.
It would be acceptable as long as the key event doesn't loose key. Perhaps it would be more work on the game programmer side but it is customary in game programming world to do such things.