Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Autotexts loses spaces
#1
I recently (I think it started with 1.1.8, but I was too busy to look into it at the time.) noticed a problem with Autotexts: any texts that include one or more space characters "arrive" w/o the spaces.

For example:
tr["#mb"]  = "Michael Baas";

prints: "Michael Baas"

or

tr["#pt"] = "C:\\Data\\MB Privat\\Michael\\Profil Michael Baas.docx";

prints: "C:\Data\MBPrivat\Michael\ProfilMichaelBaas.docx"
#2
Please help to reproduce this. In what apps it happens etc.
#3
Sure, I'm happy to help - just don't know how - so I'll do whatever you tell me Wink

It happens when typing browser edit fields (like this msg), VS Code, Word, VS Code - all these are apps where I had successfully used those replacements before.
And I have other (longer) replacements that ofc also contain blanks - they all have the same problem. Text comes across fine, spaces missing.

Actually...I'm sorry: I (unintentionally) left out the most important bit of all: I have migrated to a new PC and the problem only occurs there. (I have checked: the shortcuts still work on my old machine with v1.2)  Sorry for the confusion - I hadn't thought changing machine would affect this. On hand it's more plausible (totally new environment), on the other hand: why should the environment have an impact "just" on space?
#4
If spaces are missing in autotext replacements, the same should happen in any script that uses keys.send or keys.sendt.

To send text, keys.send (and autotext) uses Windows API function SendInput. For spaces, tabs and newlines it uses the key code. For other characters by default uses special key code VK_PACKET, which usually works better. Maybe some software app or script blocks key events that use normal key codes but not those using VK_PACKET. Need to somehow identify that software, and uninstall or change its behavior if possible.

Or try to change options in the autotext triggers file, near the start. Examples:

Code:
Copy      Help
opt.key.TextHow = OKeyText.Paste;
//or
opt.key.TextHow = OKeyText.KeysOrPaste;
#5
Thanks - "Paste" did it!"

It's interesting that such a conflict would arise on the new machine - I don't have as much utilities installed there (yet) as on my old machine! But it's Lenovo and the old one was Dell - perhaps they have some conflicting tools. I will experiment to see where this came from...

Duh...here's a surprise: Paste.Characters; also worked. It's the default - so NOT setting opt.key.TextHow at all also works now!
I have not rebooted or even consciously started/exited any apps, I have no idea what's different now Angry

Weird stuff...these computers! (And the humans in fronf of 'em!) Cool
#6
Today the issue came up again!
And I still have opt.key.TextHow = OKeyText.Paste; in my code!

I then tried to disable apps in systray to see if I could get it work again - and indeed, after exiting PowerToys, things were back to normal!

Which is interesting - because I've been using PT for quite a while now. Maybe they changed something in a recent update...
#7
I tested disabling various toys of PT, and "Quick Accent" is the culprit!

I'd be happy to log a but report against it, but I am not entirely sure how to explain the details of it.

Can you help me out with details or would like you to look into it yourself?
#8
Details are like you describe it here. Sometimes spaces are lost when an automation software sends text input (uses Windows API function SendInput).

I tested PowerToys Quick Accent, but could not reproduce this.
#9
Sorry, this was incorrect:
 
Code:
Copy      Help
opt.key.TextHow = OKeyText.Paste;

The above can be used elsewhere, but in the autotext file use this instead:
 
Code:
Copy      Help
Triggers.Options.BeforeAction = o => { opt.key.TextHow = OKeyText.Paste; };

It could be a temporary workaround until they will fix this.
#10
Thanks - but it doesn't help - spaces are stil removed!

Reported the issue - let's see if and what they reply.

Ha, I got a bot reply which suggested a similarity with an issue that an AutoHotKey user had reported. Following the discussion, I disabled space as activation key for QA and now LA's replacements work as intended.


Forum Jump:


Users browsing this thread: 1 Guest(s)