Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

EditKeys updates

Charles Dye

Super Moderator
May
4,971
128
Staff member
I've uploaded a new build of EditKeys. This version includes many many changes to the code and the documentation, so please beat on it and report any issues in this forum.
 
Thanks @Charles Dye

Not a big deal if this cannot be implemented, but, as an example;
Code:
echo %_isodate
I then press Alt-C to copy the command line to the clipboard.

Pressing Ctrl-Shift-X gives me;
Code:
echo 2022-07-23
All good. If I want the original line back;
Code:
echo %_isodate
...I do a Ctrl-V, which gives me the command line that I saved using Ctrl-C. Again, all good.

Would it be possible to, after pressing Ctrl-Shift-X, that I could use Ctrl-Z to undo the
Code:
echo 2022-07-23
back to
Code:
echo %_isodate
?

Joe
 
Would it be possible to, after pressing Ctrl-Shift-X, that I could use Ctrl-Z to undo the
Code:
echo 2022-07-23
back to
Code:
echo %_isodate
?

I wish — but the undo/redo mechanism doesn't seem to be accessible to plugins. (Anybody know something I don't? Vince?)

Another thing that doesn't seem to be exposed is TCC's text selection. Which is why so many of the actions act on "the word at the cursor" or "the argument at the cursor", and not the current selection.
 
I wish — but the undo/redo mechanism doesn't seem to be accessible to plugins. (Anybody know something I don't? Vince?)
Do you mean Alt-Z and Alt-Y? If so, you might be able to use SendInput() to invoke those actions. I just happen to have a new SendKeystrokeWithModifiers() hanging around.
 
The strategy does work. Do this in one colsole

Code:
delay 5 & keystack foo /w6 Alt-z /w6 Alt-y

and switch to another console within the 5 seconds. You'll see "foo", then the last "o" erased and then restored.
 
That would be one way to invoke Undo and Redo, sure. My question is whether there is any way for a plugin key handler to inform TCC that a change has been made, so Undo and Redo will do the right thing. (Maybe setting fRedraw ought to do this...?)
 
That would be one way to invoke Undo and Redo, sure. My question is whether there is any way for a plugin key handler to inform TCC that a change has been made, so Undo and Redo will do the right thing. (Maybe setting fRedraw ought to do this...?)
I didn't think of that and I don't know the answer. I suppose accomplishing all the edits with simulated keystrokes would do it but that would be hard and ugly.

Another thing is that using keystrokes to trigger simulated keystrokes is very iffy (I found out the hard way). If any of the triggering keys are still down when the simulation begins (very likely), it screws up the simulation.

I wanted to have a single key-chord open my running, tray-minimized, Outlook (first icon on the left). My traykeys.exe did the right thing (send RWin-B, Right, Enter). That worked fine when traykeys.exe was started at a command line but failed it was when assigned to a key-chord with an @@alias or with AutoHotKey. I spent quite a while on it and have more ideas but I'm not optimistic. Fortunately, I could hardware-program my Gateway 2000 Anykey keyboard so that Ctrl-Alt-O sent RWin-B, Right, Enter. That worked fine but I'd still like a software solution.
 
Fortunately, I could hardware-program my Gateway 2000 Anykey keyboard so that Ctrl-Alt-O sent RWin-B, Right, Enter. That worked fine but I'd still like a software solution.

Whoa.... I wouldn't have thought it was possible to use an AnyKey anymore. Was there ever a USB AnyKey, or are you doing something tricky? (Or just using a really old computer?)

(And... are you perhaps a Vernor Vinge fan?)
 
Whoa.... I wouldn't have thought it was possible to use an AnyKey anymore. Was there ever a USB AnyKey, or are you doing something tricky? (Or just using a really old computer?)

(And... are you perhaps a Vernor Vinge fan?)
I always make sure my Dells have PS/2 ports (real ones). That was the default for workstations. I don't know about today. I have four Anykey keyboards. They are cleaned, lubed with silicone, and rotated regularly. I know nothing of Vernor Vinge and the pic tells me little.

The solution to the problem with the activating keystrokes interfering with the simulated ones was easy to come by (see below) but it had the unfortunate and inescapable side effect of delaying the desired action until the activating keys are released.

Code:
    // wait for all modifiers up (kind of a kludge, but necessary)
    while ( 0x8000 & (GetKeyState(VK_CONTROL) | GetKeyState(VK_MENU) | GetKeyState(VK_SHIFT) | GetKeyState(VK_LWIN) | GetKeyState(VK_RWIN)) )
        Sleep(1);
 
Back
Top