On some specific targets there is no way to query the state of a single key through the keyboard matrix. So the program is forced to query the state of the entire matrix, one key at a time, and at every interrupt -- and this, indeed, takes time. It would be useful to introduce a quick way to scan the keys, limiting it to those specifically requested by the program. This behavior would be triggered by the DEFINE KEYBOARD OPTIMIZED directive and disabled by the DEFINE KEYBOARD FULL directive.
In a nutshell, it would involve changing the implementation, so as not to scan the entire set of keys but only those specifically requested. This behavior would be enabled automatically, but disabled in the following cases:
- use of
INPUT commands;
- use of
KEY PRESSED or KEY STATE commands, with dynamic variables.
On some specific targets there is no way to query the state of a single key through the keyboard matrix. So the program is forced to query the state of the entire matrix, one key at a time, and at every interrupt -- and this, indeed, takes time. It would be useful to introduce a quick way to scan the keys, limiting it to those specifically requested by the program. This behavior would be triggered by the
DEFINE KEYBOARD OPTIMIZEDdirective and disabled by theDEFINE KEYBOARD FULLdirective.In a nutshell, it would involve changing the implementation, so as not to scan the entire set of keys but only those specifically requested. This behavior would be enabled automatically, but disabled in the following cases:
INPUTcommands;KEY PRESSEDorKEY STATEcommands, with dynamic variables.