|
Post by Bob Engelhardt on Jun 2, 2022 16:34:01 GMT
The extended ASCII characters don't have keyboard keys, but can be entered with ALT sequences. E.g., the degree symbol (°) can be entered by typing "ALT 0176". Is it possible to create an MMM macro that would do this & have it bound to a hotkey? In other words, I would like to be able to enter the degree symbol simply by pressing a hotkey. Thanks, Bob
|
|
|
Post by cyberchipz on Jun 2, 2022 18:09:06 GMT
The extended ASCII characters don't have keyboard keys, but can be entered with ALT sequences. E.g., the degree symbol (°) can be entered by typing "ALT 0176". Is it possible to create an MMM macro that would do this & have it bound to a hotkey? In other words, I would like to be able to enter the degree symbol simply by pressing a hotkey. Thanks, Bob Hmmm, programmable hot keys... sounds interesting. Perhaps something that ran an external macro would be very useful. I imagine an instance of MMM would have to be running; but not necessarily. One could easily write code to do a single action. I picture something like a menu code that would execute particular code when a "Hotkey" is pressed... in a menu this would be a jump to that code and stop. Perhaps, hotkeys that cause a jump to a line of code could be created. I'm just trying to think of ways this could be implemented in an existing MMM environment. I've always kind of wanted to have a Menu type feature, other than an input line requesting a response; perhaps an interrupt that would force MMM to execute the code even if specific code monitoring keystrokes wasn't running as a macro itself? Could be heavy overhead to monitor key inputs, but not if it grabed the code, and then returned the any "non" hotkeys pressed back to the OS. (A short key monitoring wedge) Plus I know interrupts are sensitive to run time conditions... don't want to overrun housekeeping actions.... the only thing it would need to do is recognize the hotkey pressed, if one, and pass the action to the system, activate MMM to run an external macro. It could use a dedicated memory space or file; be limited in function (size) and store small macros, be initialized at startup on the machine. Might be a bit much. But, maybe not so much if one *required* a particular instance of MMM running to execute. Conflicts could be an issue; first come, first serve. Sounds a little outside of MMM features though... still it's interesting. You may already have this embedded into MMM for handling "hotkeys" ;-) I only wonder how we'd co-opt already claimed Hotkeys by the OS; this could be an issue.
|
|
|
Post by Bob Engelhardt on Jun 2, 2022 19:18:51 GMT
Maybe I used the term "hotkey" inappropriately, as MMM has "hotkeys". I merely meant having the macro assigned to a specific key.
|
|
|
Post by philranger on Jun 3, 2022 20:20:26 GMT
|
|
|
Post by bobengelhardt on Jun 3, 2022 22:04:35 GMT
I realize now that what I want, is to do Quick Launch of the macro, using a key that I'd pick. That would be straight forward.
The hard part is getting the code sent. I have tried "Keypress %integer%" with integer set to 176, but that sends "1","7","6".
Recording "ALT 0176" gives:
1 | 34 | 74 | 150 | Keypress Alt+ | numpad0 2 | 34 | 74 | 150 | Keypress Alt+ | numpad1 3 | 34 | 74 | 150 | Keypress Alt+ | numpad7 4 | 34 | 74 | 150 | Keypress Alt+ | numpad6
Playing that gives "06/03/2022 05:36:41.12 PM Playback error: 1 | 34 | 74 | 150 | Keypress Alt+ | numpad0 - Not a standard action [not an error]: Keyword 'numpad0' is not valid."
Then I tried
"1 | 34 | 74 | 150 | Keypress °" which gave " 06/03/2022 05:56:46.75 PM Macro playback finished", but didn't send "°"
Getting even more basic,
"1 | 34 | 74 | 150 | Keypress Z" didn't send "Z" either.
My basic problem is just not having a clue.
|
|
|
Post by Steve on Jun 4, 2022 1:01:16 GMT
Hi bobengelhardtUnfortunately MMM cannot paste your ASCII chars from a keyboard entry. The only way to get these down is to copy them into the internal clipboard and paste them. 1 | RUN ACTION | SELECT WINDOW BY NAME | ASCII.txt - Notepad 2 | RUN ACTION | COPY TO CLIPBOARD | ° 3 | RUN ACTION | WAIT MILLISECONDS | 100 4 | RUN ACTION | PASTE FROM CLIPBOARD This simple macro above selects an open notepad doc saved with a window title of 'ASCII.txt - Notepad', copies the ASCII char 'ALT 0176' to the clipboard, waits 100 ms (it's too fast without this), and then paste's this to the selected notepad document.
|
|
|
Post by philranger on Jun 4, 2022 23:22:42 GMT
What about trying to define a string with that character directly?
|
|
|
Post by Steve on Jun 5, 2022 2:47:17 GMT
Yep that works too. 1 | RUN ACTION | SELECT WINDOW BY NAME | ASCII.txt - Notepad 2 | RUN ACTION | DEFINE STRING VARIABLE | ASCII::° 3 | RUN ACTION | COPY TO CLIPBOARD | %ASCII% 4 | RUN ACTION | WAIT SECONDS | 1 5 | RUN ACTION | PASTE FROM CLIPBOARD And the string directly too. Nice one philranger 1 | RUN ACTION | SELECT WINDOW BY NAME | ASCII.txt - Notepad 2 | RUN ACTION | DEFINE STRING VARIABLE | ASCII::° 3 | RUN ACTION | WAIT SECONDS | 1 4 | RUN ACTION | KEYPRESS | %ASCII%
|
|
|
Post by bobengelhardt on Jun 5, 2022 17:11:20 GMT
[...] And the string directly too. Nice one philranger 1 | RUN ACTION | SELECT WINDOW BY NAME | ASCII.txt - Notepad 2 | RUN ACTION | DEFINE STRING VARIABLE | ASCII::° 3 | RUN ACTION | WAIT SECONDS | 1 4 | RUN ACTION | KEYPRESS | %ASCII%
Great, that's getting real close. Now, in my total cluelessness, I have to ask: is there a way to do it without selecting a window? To do it in the active window? E.g., if I'm composing an MMM Reply (in a FireFox tab), can I run this macro simply by pressing a key (e.g., ALT F6) to which this macro has been bound/assigned? And the "°" is added to the Reply text?
|
|
|
Post by Steve on Jun 6, 2022 6:33:09 GMT
Yep best bet for that is to save the macro as a .mmmacro file and assign it to a quick launch slot. Quick launch (options - quick launch) can bind macro saves to hotkeys.
|
|
|
Post by bobengelhardt on Jun 6, 2022 17:53:33 GMT
I GOT IT!!!!
The "run in the active window" happens when I simply don't do a "SELECT WINDOW". And since I don't have to wait for the window selection, I took out the "WAIT". So it's just:
1 | RUN ACTION | DEFINE STRING VARIABLE | ASCII::° 2 | RUN ACTION | KEYPRESS | %ASCII%
And the Quick Launch has nothing selected except "On", assigned to F5 key.
Works a dream!! I tried it in all my usual applications: mail reader, FireFox, Open Office, various editors.
Now, to make macros for some other extended ASCII characters. E.g., ±, ×, •
Thank you! I'll be doing a Donate.
Oh, wait: am I missing anything?
Bob
|
|
|
Post by philranger on Jun 6, 2022 18:51:44 GMT
When you have the full version you can assign different macros to different keys!
|
|