ID:2115478
 
Resolved
A new macro, Any, can be used to detect key/button presses, and Any+UP will detect releases. (+REP is not supported.) In the command, [[*]] is replaced by the key/button name.
Applies to:DM Language
Status: Resolved (511.1348)

This issue has been resolved.
It'd be nice to have an Any macro that could be used to grab key-up/down info for all keys.
Lummox JR resolved issue with message:
A new macro, Any, can be used to detect key/button presses, and Any+UP will detect releases. (+REP is not supported.) In the command, [[*]] is replaced by the key/button name.
This doesn't prevent the default input control from automatically focusing and receiving typed keys, but the command still runs. Bug?
Bug or not, that's kind of cool. You can literally capture input no matter what (I bet that's some crazy overhead though).
In response to Kaiochao
Kaiochao wrote:
This doesn't prevent the default input control from automatically focusing and receiving typed keys, but the command still runs. Bug?

I'd have to say the key-down being caught is a bug. (And therefore the accompanying key-up.) If the input control has focus and steals the key, then no macro should run at all. I probably forgot to do whatever check I'm doing for IsCharKey() in the right place.
In response to Lummox JR
The problem is that the input control doesn't have focus before it steals both focus and the key.
In response to Kaiochao
The default input control should still steal focus when it's an alphanumeric character, but the correct behavior is that the Any macro should not fire in that case. If the Any macro is firing, that's a bug.
In response to Lummox JR
Okay, so the Any macro is supposed to fire alongside other defined macros, otherwise not at all? I had the wrong impression about this.
The Any macro should fire even if you don't have a defined macro, but only at a time when a defined macro would have fired if it existed.
In response to Lummox JR
Is there any way we can prevent the default input from stealing focus if we want to just use the Any macro?

That is, for the input to behave as if every key has a macro, so the only way to type into it is to give it focus explicitly.
In response to Kaiochao
Kaiochao wrote:
Is there any way we can prevent the default input from stealing focus if we want to just use the Any macro?

That is, for the input to behave as if every key has a macro, so the only way to type into it is to give it focus explicitly.

To do that, turn off the default flag. A default input will always steal focus when it thinks you're typing a command.
In response to Lummox JR
I tried that before, but it's automatically made the default input..