WWO
Full Member
Posts: 21
|
Post by WWO on Mar 5, 2021 11:44:55 GMT
I have seen minimousemacro.proboards.com/thread/283/keypress-inconsistent-behaviourIs there a way to detect that caps lock is on?
[I have other (non-mmm) scripts that check for caps lock and sleeps for a second - gives the user an ability to 'pause' a script that uses the mouse, then unpause when ready. Looking to effect the same behaviour here in mmm. Yes, it must be caps lock - no sense making the user have to remember which key in which program they're in.]
^F9 doesn't do it, as the user has no way to know where in the script things are, to know where to return to. Caps Locks detection can wait for an innocuous spot (e.g. sleep point at end of a sequence of steps).
|
|
|
Post by Steve on Mar 15, 2021 9:00:41 GMT
Hi WWO Not easily and not without doing something like I suggested here minimousemacro.proboards.com/thread/283/keypress-inconsistent-behaviourHi Steve, On a related note: is there a way to check for or ideally toggle Caps Lock in a MMM script? To help programmatically avoid issues like danman mentioned? Because I've had Caps Lock adversely affect my scripts as well. Hi, Yeah this is what I've got to detect a caps and prompt. You could prob compress this down to a few lines: 1 | RUN ACTION | FILE CREATE | C:\Users\test\Desktop\caps.txt 2 | RUN ACTION | WAIT SECONDS | 1 3 | RUN ACTION | RUN PROGRAM | C:\Users\test\Desktop\caps.txt 4 | RUN ACTION | WAIT SECONDS | 1 5 | x | x | 500 | Keypress test 6 | X | X | 500 | Keypress Ctrl+ | a 7 | X | X | 500 | Keypress Ctrl+ | c 8 | X | X | 500 | Keypress Alt+ | f 9 | X | X | 500 | Keypress x 10 | X | X | 500 | Keypress n 11 | IF | CLIPBOARD | VALUE | TEXT IS | test | MESSAGE PROMPT | Caps is not on::CAPS - Status::0 | ELSE | 11 | RUN ACTION | MESSAGE PROMPT | Caps is on::CAPS - Status::0 This detects and toggles capslock: 1 | RUN ACTION | FILE CREATE | C:\Users\test\Desktop\caps.txt 2 | RUN ACTION | WAIT SECONDS | 1 3 | RUN ACTION | RUN PROGRAM | C:\Users\test\Desktop\caps.txt 4 | RUN ACTION | WAIT SECONDS | 1 5 | x | x | 500 | Keypress test 6 | X | X | 500 | Keypress Ctrl+ | a 7 | X | X | 500 | Keypress Ctrl+ | c 8 | X | X | 500 | Keypress Alt+ | f 9 | X | X | 500 | Keypress x 10 | X | X | 500 | Keypress n 11 | IF | STRING VARIABLE | %CLIPBOARD% | CONTAINS | test | GOTO MACRO LINE | Down 2 12 | X | X | 500 | Keypress capslock 13 | RUN ACTION | MESSAGE PROMPT | End of the macro::The End::1
|
|
WWO
Full Member
Posts: 21
|
Post by WWO on Mar 15, 2021 19:35:24 GMT
Yeah, I saw that. Ick.
I did come across
( _WinAPI_GetKeyState(0x14) & 0x01 ) = 0x01 ? True : False but I haven't dug into it for a mmm equivalent.
|
|