StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
kookob  
#1 Posted : Friday, March 13, 2020 1:03:40 PM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
I defined some 'text expansion' in different applications. like xshell, navcat , cmd.
But the text frequently not work.
And I must right-click the tray icon and reload the script and it can work well a few times.
Is this a bug?
Rob  
#2 Posted : Friday, March 13, 2020 1:58:25 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
That can be a difficult one to troubleshoot.

What method do you have selected for the text expansions? (Text, Text via Clipboard, etc)
If you have any clipboard methods selected, try just using the Text one, as sometimes the clipboard can be locked by another application.

Also, you can download and run the trace version of S+ which will log data that I can use to try and figure out what's happening.
See this post: https://forum.strokesplus.net/posts/t3012-Tracing-Logging-Builds-for-Troubleshooting

When it starts or from the tray icon Set Trace Options menu item, only select TextExpansionEvents then let it run and use S+ like normal.

When you start having the issue, EXIT StrokesPlus.net (to stop logging, so I can see the problems at the end of the log file) and go you where your settings file is located, which for the installer is C:\Users\{YOUR_USERNAME}\AppData\Roaming\StrokesPlus.net\Log, and send me the latest log file.
kookob  
#3 Posted : Friday, March 13, 2020 2:13:48 PM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
I have not used any clip.
I have installed the trace version, and I will pay close attention to this error.
btw:
The 'Text Expansion' I added under the Global Actions is worked well.
kookob  
#4 Posted : Saturday, March 14, 2020 11:55:13 AM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
Hi, Rob, the error is reappear.
Nearest log below:
Quote:

2020/3/14 19:48:01: KeyboardHook.cs::KeyboardProc(): Delete, clearing token:
2020/3/14 19:49:28: KeyboardHook.cs::KeyboardProc(): Character added to token: l
2020/3/14 19:49:28: KeyboardHook.cs::KeyboardProc(): Character added to token: li
2020/3/14 19:49:28: KeyboardHook.cs::KeyboardProc(): Character added to token: lik
2020/3/14 19:49:28: KeyboardHook.cs::KeyboardProc(): Character added to token: like
2020/3/14 19:49:29: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token: like
2020/3/14 19:49:29: KeyboardHook.cs::KeyboardProc(): Trigger match, token: like
2020/3/14 19:49:29: KeyboardHook.cs::KeyboardProc(): Setting application
2020/3/14 19:49:29: KeyboardHook.cs::KeyboardProc(): No matches, clearing token
2020/3/14 19:49:34: KeyboardHook.cs::KeyboardProc(): Character added to token: s
2020/3/14 19:49:35: KeyboardHook.cs::KeyboardProc(): Character added to token: st
2020/3/14 19:49:36: KeyboardHook.cs::KeyboardProc(): Delete, clearing token: st
2020/3/14 19:49:37: KeyboardHook.cs::KeyboardProc(): Delete, clearing token:
2020/3/14 19:49:38: KeyboardHook.cs::KeyboardProc(): Delete, clearing token:
2020/3/14 19:49:38: KeyboardHook.cs::KeyboardProc(): Delete, clearing token:
2020/3/14 19:49:40: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token:
2020/3/14 19:49:40: KeyboardHook.cs::KeyboardProc(): Non trigger match, clearing token:
2020/3/14 19:50:08: KeyboardHook.cs::KeyboardProc(): Delete, clearing token:
2020/3/14 19:50:08: KeyboardHook.cs::KeyboardProc(): Delete, clearing token:
2020/3/14 19:50:08: KeyboardHook.cs::KeyboardProc(): Delete, clearing token:
2020/3/14 19:50:09: KeyboardHook.cs::KeyboardProc(): Delete, clearing token:
2020/3/14 19:50:09: KeyboardHook.cs::KeyboardProc(): Delete, clearing token:
2020/3/14 19:50:09: KeyboardHook.cs::KeyboardProc(): Delete, clearing token:
2020/3/14 19:50:09: KeyboardHook.cs::KeyboardProc(): Delete, clearing token:
2020/3/14 19:50:31: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token:
2020/3/14 19:50:31: KeyboardHook.cs::KeyboardProc(): Non trigger match, clearing token:
2020/3/14 19:50:32: KeyboardHook.cs::KeyboardProc(): Character added to token: l
2020/3/14 19:50:32: KeyboardHook.cs::KeyboardProc(): Character added to token: li
2020/3/14 19:50:32: KeyboardHook.cs::KeyboardProc(): Character added to token: lik
2020/3/14 19:50:32: KeyboardHook.cs::KeyboardProc(): Character added to token: like
2020/3/14 19:50:32: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token: like
2020/3/14 19:50:32: KeyboardHook.cs::KeyboardProc(): Trigger match, token: like
2020/3/14 19:50:32: KeyboardHook.cs::KeyboardProc(): Setting application
2020/3/14 19:50:32: KeyboardHook.cs::KeyboardProc(): No matches, clearing token
2020/3/14 19:50:32: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token:
2020/3/14 19:50:32: KeyboardHook.cs::KeyboardProc(): Trigger match, token:
2020/3/14 19:50:47: KeyboardHook.cs::KeyboardProc(): Delete, clearing token:

Rob  
#5 Posted : Sunday, March 15, 2020 3:20:29 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
What is the token you're trying to match on, is it "like"?

Also, what's the application definition where the text expansion is defined?
kookob  
#6 Posted : Sunday, March 15, 2020 3:51:21 AM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
Yes, is "like"
And the application is XShell
Application name: Xshell.*exe (selected regular)

I used XshellCore.exe before, But the text expansion can't work frequently, so I change the match name. There is no effect to thorough solve this problem.
Rob  
#7 Posted : Sunday, March 15, 2020 2:19:08 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Okay, so it looks like it's failing to match the application internally. So in order to be efficient, the last active window is captured in the WinEvent Hook that is called when a new window becomes active. When this happens, S+ stored the handle (hwnd) of that window. When a text expansion token is hit, it uses that last active window handle to perform the application match.

It's possible that something within that last active window code is not functioning properly.

One question: Are you running the portable or installer version of S+?

I've added an extra tracing statement right after "Setting application" which will output what window it thinks is the active one, so try to run the trace again so we can see what is happening.

Trace Version Portable ZIP

Trace Version Installer


Also, include this Trace Option as well, sine that will also include some of the app matching trace output:

ApplicationMatchingGeneralEvents
Rob  
#8 Posted : Sunday, March 15, 2020 2:24:43 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
I made CMD an application and added a "cc" token, so this is what the trace output should now look like.

You can see after "Setting application" is adds a line with a couple quick reference details, then in ApplicationMatching.cs it dumps a lot more detail, ending with "AppMatched: CMD"

Code:
3/15/2020 10:21:18 AM: KeyboardHook.cs::KeyboardProc(): Character added to token: c
3/15/2020 10:21:18 AM: KeyboardHook.cs::KeyboardProc(): Character added to token: cc
3/15/2020 10:21:18 AM: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token: cc
3/15/2020 10:21:18 AM: KeyboardHook.cs::KeyboardProc(): Trigger match, token: cc
3/15/2020 10:21:18 AM: KeyboardHook.cs::KeyboardProc(): Setting application
3/15/2020 10:21:18 AM: KeyboardHook.cs::KeyboardProc(): Process: cmd.exe - Text: Command Prompt - Owner Title: Command Prompt
3/15/2020 10:21:18 AM: ApplicationMatching.cs::LoadApplicationQualifiers(): OwnerClassName: ConsoleWindowClass
3/15/2020 10:21:18 AM: ApplicationMatching.cs::LoadApplicationQualifiers(): RootClassName: ConsoleWindowClass
3/15/2020 10:21:18 AM: ApplicationMatching.cs::LoadApplicationQualifiers(): ParentClassName: #32769
3/15/2020 10:21:18 AM: ApplicationMatching.cs::LoadApplicationQualifiers(): ControlClassName: ConsoleWindowClass
3/15/2020 10:21:18 AM: ApplicationMatching.cs::LoadApplicationQualifiers(): OwnerWindowText: Command Prompt
3/15/2020 10:21:18 AM: ApplicationMatching.cs::LoadApplicationQualifiers(): RootWindowText: Command Prompt
3/15/2020 10:21:18 AM: ApplicationMatching.cs::LoadApplicationQualifiers(): ParentWindowText: 
3/15/2020 10:21:18 AM: ApplicationMatching.cs::LoadApplicationQualifiers(): ControlWindowText: Command Prompt
3/15/2020 10:21:18 AM: ApplicationMatching.cs::LoadApplicationQualifiers(): ControlID: 0
3/15/2020 10:21:18 AM: ApplicationMatching.cs::GetProcessPath(): About to get process and try accessing the MainModule
3/15/2020 10:21:18 AM: ApplicationMatching.cs::GetProcessPath(): proc.MainModule.FileName: C:\WINDOWS\system32\cmd.exe - proc.MainModule.FileName.ToString(): C:\WINDOWS\system32\cmd.exe
3/15/2020 10:21:18 AM: ApplicationMatching.cs::LoadApplicationQualifiers(): AppPath: C:\WINDOWS\system32
3/15/2020 10:21:18 AM: ApplicationMatching.cs::LoadApplicationQualifiers(): AppImageName: cmd.exe
3/15/2020 10:21:18 AM: ApplicationMatching.cs::CriteriaMatched(): Criteria String: VMPlayerFrame Actual Value: ConsoleWindowClass
3/15/2020 10:21:18 AM: ApplicationMatching.cs::CriteriaMatched(): [Regex] Criteria String: Wow.* Actual Value: cmd.exe
3/15/2020 10:21:18 AM: ApplicationMatching.cs::CriteriaMatched(): Criteria String: VirtualBox.exe Actual Value: cmd.exe
3/15/2020 10:21:18 AM: ApplicationMatching.cs::CriteriaMatched(): Criteria String: TV_CClientWindowClass Actual Value: ConsoleWindowClass
3/15/2020 10:21:18 AM: ApplicationMatching.cs::CriteriaMatched(): Criteria String: (?i)notepad.* Actual Value: cmd.exe
3/15/2020 10:21:18 AM: ApplicationMatching.cs::CriteriaMatched(): Criteria String: chrome.exe Actual Value: cmd.exe
3/15/2020 10:21:18 AM: ApplicationMatching.cs::CriteriaMatched(): Criteria String: EXCEL.EXE Actual Value: cmd.exe
3/15/2020 10:21:18 AM: ApplicationMatching.cs::CriteriaMatched(): Criteria String: SysListView32 Actual Value: ConsoleWindowClass
3/15/2020 10:21:18 AM: ApplicationMatching.cs::CriteriaMatched(): Criteria String: Ssms.exe Actual Value: cmd.exe
3/15/2020 10:21:18 AM: ApplicationMatching.cs::CriteriaMatched(): Criteria String: firefox.exe Actual Value: cmd.exe
3/15/2020 10:21:18 AM: ApplicationMatching.cs::CriteriaMatched(): Criteria String: terminal64.exe Actual Value: cmd.exe
3/15/2020 10:21:18 AM: ApplicationMatching.cs::CriteriaMatched(): Criteria String: cmd.exe Actual Value: cmd.exe
3/15/2020 10:21:18 AM: ApplicationMatching.cs::ApplicationMatched(): Set App: AppMatched: CMD
kookob  
#9 Posted : Monday, March 16, 2020 1:55:52 AM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
Thank you.
I am running the installer version.
I will try the new 'trace version install' and keep trace of this problem.
kookob  
#10 Posted : Monday, March 16, 2020 2:05:52 AM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
Hi, Rob
I installed the new trace version.
But the output logs is different with your paste
like this:
Quote:
2020/3/16 10:04:13: KeyboardHook.cs::KeyboardProc(): Character added to token: c
2020/3/16 10:04:13: KeyboardHook.cs::KeyboardProc(): Character added to token: cc
2020/3/16 10:04:13: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token: cc
2020/3/16 10:04:13: KeyboardHook.cs::KeyboardProc(): Trigger match, token: cc
2020/3/16 10:04:13: KeyboardHook.cs::KeyboardProc(): Setting application
2020/3/16 10:04:13: KeyboardHook.cs::KeyboardProc(): Process: cmd.exe - Text: C:\Windows\system32\cmd.exe - Owner Title: C:\Windows\system32\cmd.exe
2020/3/16 10:04:13: KeyboardHook.cs::KeyboardProc(): Application match: cc
2020/3/16 10:04:13: [1] HookState.cs::TextExpansionComplete(): Enter function:
2020/3/16 10:04:13: [24] HookState.cs::FireTextExpansionThread(): Entering function
2020/3/16 10:04:13: [24] HookState.cs::FireTextExpansionThread(): Sending backspaces
2020/3/16 10:04:13: [24] HookState.cs::FireTextExpansionThread(): Name: cc - TextExpansionType: Text
2020/3/16 10:04:13: [24] HookState.cs::FireTextExpansionThread(): Text: hello cc
2020/3/16 10:04:14: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token:
2020/3/16 10:04:14: KeyboardHook.cs::KeyboardProc(): Non trigger match, clearing token:
2020/3/16 10:04:15: [1] HookState.cs::WinEventProc(): Foreground Window Changed, clear current token ()
2020/3/16 10:04:21: [1] HookState.cs::WinEventProc(): Foreground Window Changed, clear current token ()
2020/3/16 10:04:26: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token:
2020/3/16 10:04:26: KeyboardHook.cs::KeyboardProc(): Trigger match, token:
2020/3/16 10:04:26: [1] HookState.cs::WinEventProc(): Foreground Window Changed, clear current token ()
2020/3/16 10:04:26: [1] HookState.cs::WinEventProc(): Foreground Window Changed, clear current token ()
2020/3/16 10:04:26: [1] HookState.cs::WinEventProc(): Foreground Window Changed, clear current token ()
2020/3/16 10:04:26: [1] HookState.cs::WinEventProc(): Foreground Window Changed, clear current token ()
Rob  
#11 Posted : Monday, March 16, 2020 2:49:59 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Did you right-click the tray icon, select Set Trace Options, and check the ApplicationMatchingGeneralEvents box also?
kookob  
#12 Posted : Monday, March 16, 2020 3:01:55 AM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
Not yet. Now I have done it.
kookob  
#13 Posted : Monday, March 16, 2020 12:12:56 PM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
Hi, Rob,
The problem is reappears.
Quote:
2020/3/16 20:09:53: KeyboardHook.cs::KeyboardProc(): Character added to token: l
2020/3/16 20:09:53: KeyboardHook.cs::KeyboardProc(): Character added to token: li
2020/3/16 20:09:53: KeyboardHook.cs::KeyboardProc(): Character added to token: lik
2020/3/16 20:09:54: KeyboardHook.cs::KeyboardProc(): Character added to token: like
2020/3/16 20:09:54: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token: like
2020/3/16 20:09:54: KeyboardHook.cs::KeyboardProc(): Trigger match, token: like
2020/3/16 20:09:54: KeyboardHook.cs::KeyboardProc(): Setting application
2020/3/16 20:09:54: KeyboardHook.cs::KeyboardProc(): Error setting application: 无法枚举进程模块。 - Inner:
2020/3/16 20:09:54: ApplicationMatching.cs::LoadApplicationQualifiers(): OwnerClassName: Notepad++
2020/3/16 20:09:54: ApplicationMatching.cs::LoadApplicationQualifiers(): RootClassName: Notepad++
2020/3/16 20:09:54: ApplicationMatching.cs::LoadApplicationQualifiers(): ParentClassName: Notepad++
2020/3/16 20:09:54: ApplicationMatching.cs::LoadApplicationQualifiers(): ControlClassName: Scintilla
2020/3/16 20:09:54: ApplicationMatching.cs::LoadApplicationQualifiers(): OwnerWindowText:
2020/3/16 20:09:54: ApplicationMatching.cs::LoadApplicationQualifiers(): RootWindowText:
2020/3/16 20:09:54: ApplicationMatching.cs::LoadApplicationQualifiers(): ParentWindowText:
2020/3/16 20:09:54: ApplicationMatching.cs::LoadApplicationQualifiers(): ControlWindowText:
2020/3/16 20:09:54: ApplicationMatching.cs::LoadApplicationQualifiers(): ControlID: 0
2020/3/16 20:09:54: ApplicationMatching.cs::GetProcessPath(): About to get process and try accessing the MainModule
2020/3/16 20:09:54: ApplicationMatching.cs::GetProcessPath(): GetProcessPath failed: Probably trying to access elevated process. Trying WinAPI method...
2020/3/16 20:09:54: ApplicationMatching.cs::GetProcessPath(): WinAPI method success, hProcess: 0
2020/3/16 20:09:54: ApplicationMatching.cs::GetProcessPath(): WinAPI method success, fileName:
2020/3/16 20:09:54: ApplicationMatching.cs::LoadApplicationQualifiers(): AppPath:
2020/3/16 20:09:54: ApplicationMatching.cs::LoadApplicationQualifiers(): AppImageName:
2020/3/16 20:09:54: ApplicationMatching.cs::CriteriaMatched(): [Regex] Criteria String: QQ Actual Value:
2020/3/16 20:09:54: ApplicationMatching.cs::CriteriaMatched(): [Regex] Criteria String: EXCEL.EXE|et.exe Actual Value:
2020/3/16 20:09:54: ApplicationMatching.cs::CriteriaMatched(): Criteria String: SysListView32 Actual Value: Scintilla
2020/3/16 20:09:54: ApplicationMatching.cs::CriteriaMatched(): Criteria String: notepad++.exe Actual Value:
2020/3/16 20:09:54: ApplicationMatching.cs::CriteriaMatched(): Criteria String: firefox.exe Actual Value:
2020/3/16 20:09:54: ApplicationMatching.cs::CriteriaMatched(): [Regex] Criteria String: webstorm64.exe|idea64.exe Actual Value:
2020/3/16 20:09:54: ApplicationMatching.cs::CriteriaMatched(): [Regex] Criteria String: Xshell.*exe Actual Value:
2020/3/16 20:09:54: ApplicationMatching.cs::CriteriaMatched(): Criteria String: cmd.exe Actual Value:
2020/3/16 20:09:54: ApplicationMatching.cs::CriteriaMatched(): Criteria String: navicat.exe Actual Value:
2020/3/16 20:09:54: ApplicationMatching.cs::SetApplication(): Set App: No App Match, Setting to Global App - hWnd = 196978
2020/3/16 20:09:54: KeyboardHook.cs::KeyboardProc(): No matches, clearing token
2020/3/16 20:09:55: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token:
2020/3/16 20:09:55: KeyboardHook.cs::KeyboardProc(): Trigger match, token:
2020/3/16 20:09:55: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token:
2020/3/16 20:09:55: KeyboardHook.cs::KeyboardProc(): Trigger match, token:
Rob  
#14 Posted : Monday, March 16, 2020 1:22:43 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Was Notepad++ the active window, or was something else?
Rob  
#15 Posted : Monday, March 16, 2020 2:04:06 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
At least we know what the problem is, since your apps are defined by EXE and it's encountering an error getting the file name, it doesn't match an app.

I've added a third method for trying to get process file names, since it's clearly failing to get the EXE name via .NET Framework, then WinAPI..so now it will also try using WMI to get processes as well.

I don't know why Microsoft makes this so difficult and inconsistent to accomplish...


First install the normal 0.3.8.3 version since there's a new dependency:

https://www.strokesplus.net/files/StrokesPlus.net_Setup_0.3.8.3.exe


Then exit S+ and install/run the trace version again:

https://www.strokesplus.net/files/StrokesPlus.net_Setup_0.3.8.3_Trace.exe
kookob  
#16 Posted : Tuesday, March 17, 2020 1:29:04 AM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
[img=https://imgur.com/nCMdoc9]https://imgur.com/nCMdoc9[/img]

That is my soft defined list.
And when the problem reappear, the notepad++ is open in the taskbar, but it not on the front.
I have installed new version and will trace the problem again.
Thank you.

Edited by user Tuesday, March 17, 2020 1:29:50 AM(UTC)  | Reason: Not specified

Rob  
#17 Posted : Tuesday, March 17, 2020 1:49:56 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Actually, since you said Notepad++ wasn't active, I just went ahead and updated the text expansion code to grab the foreground window in text expansion trigger.

Try these again and use it for a while.

First install the normal 0.3.8.3 version since there's a new dependency:

https://www.strokesplus.net/files/StrokesPlus.net_Setup_0.3.8.3.exe


Then exit S+ and install/run the trace version again:

https://www.strokesplus.net/files/StrokesPlus.net_Setup_0.3.8.3_Trace.exe
kookob  
#18 Posted : Tuesday, March 17, 2020 3:24:20 PM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
Hi, Before I update the new version.
The problem reappear again.
log below:
Quote:
2020/3/17 23:16:28: KeyboardHook.cs::KeyboardProc(): Character added to token: l
2020/3/17 23:16:28: KeyboardHook.cs::KeyboardProc(): Character added to token: li
2020/3/17 23:16:28: KeyboardHook.cs::KeyboardProc(): Character added to token: lik
2020/3/17 23:16:28: KeyboardHook.cs::KeyboardProc(): Character added to token: like
2020/3/17 23:16:29: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token: like
2020/3/17 23:16:29: KeyboardHook.cs::KeyboardProc(): Trigger match, token: like
2020/3/17 23:16:29: KeyboardHook.cs::KeyboardProc(): Setting application
2020/3/17 23:16:29: KeyboardHook.cs::KeyboardProc(): HWnd: 1379962 - Text: Text Expansion frequently not work under Applications. - Google Chrome
2020/3/17 23:16:29: KeyboardHook.cs::KeyboardProc(): Process: chrome.exe - Text: Text Expansion frequently not work under Applications. - Google Chrome - Owner Title: Text Expansion frequently not work under Applications. - Google Chrome
2020/3/17 23:16:29: KeyboardHook.cs::KeyboardProc(): No matches, clearing token
2020/3/17 23:16:29: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token:
2020/3/17 23:16:29: KeyboardHook.cs::KeyboardProc(): Trigger match, token:
2020/3/17 23:16:29: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token:
2020/3/17 23:16:29: KeyboardHook.cs::KeyboardProc(): Trigger match, token:
2020/3/17 23:16:53: KeyboardHook.cs::KeyboardProc(): Character added to token: l
2020/3/17 23:16:53: KeyboardHook.cs::KeyboardProc(): Character added to token: li
2020/3/17 23:16:53: KeyboardHook.cs::KeyboardProc(): Character added to token: lik
2020/3/17 23:16:53: KeyboardHook.cs::KeyboardProc(): Character added to token: like
2020/3/17 23:16:53: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token: like
2020/3/17 23:16:53: KeyboardHook.cs::KeyboardProc(): Trigger match, token: like
2020/3/17 23:16:53: KeyboardHook.cs::KeyboardProc(): Setting application
2020/3/17 23:16:53: KeyboardHook.cs::KeyboardProc(): HWnd: 1379962 - Text:
2020/3/17 23:16:53: KeyboardHook.cs::KeyboardProc(): Error setting application: 无法枚举进程模块。 - Inner:
2020/3/17 23:16:53: KeyboardHook.cs::KeyboardProc(): No matches, clearing token
2020/3/17 23:16:54: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token:
2020/3/17 23:16:54: KeyboardHook.cs::KeyboardProc(): Trigger match, token:
2020/3/17 23:16:54: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token:
2020/3/17 23:16:54: KeyboardHook.cs::KeyboardProc(): Trigger match, token:
2020/3/17 23:17:18: KeyboardHook.cs::KeyboardProc(): Possible trigger, test token here, token:
2020/3/17 23:17:18: KeyboardHook.cs::KeyboardProc(): Trigger match, token:


When I active the XShell.exe and input the "like", the soft can't get the correct window, the log shows is "chrome", but I have minimized the chrome yes.
And then I exit the chrome, the log output "Error setting application: 无法枚举进程模块。 - Inner: "
Now, I will install the new version your gave.
kookob  
#19 Posted : Monday, March 23, 2020 2:08:06 AM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
Hi, I installed the version you provided above, The problem no longer appear these days.
Seems to be fixed?

And one more question:
When I defined the text expansion, like "cc" to output "hello cc".
Can the cursor be moved to the middle space when outputting?
Thank you.
Rob  
#20 Posted : Monday, March 23, 2020 3:08:55 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Glad to hear!

You'd have to use the Automation Text Expansion method (Steps/Script) for that.

Such as:
Code:
sp.SendKeys("hello cc");
sp.SendModifiedVKeys([vk.RCONTROL], [vk.LEFT]); //Move cursor left one word
sp.SendVKey(vk.LEFT); //Arrow left to beginning of the space

Or just the arrow keys:
Code:
sp.SendKeys("hello cc");
sp.SendVKey(vk.LEFT); 
sp.SendVKey(vk.LEFT);
sp.SendVKey(vk.LEFT);

As you can imagine, depending on what you're trying to accomplish, there are many possibilities.
kookob  
#21 Posted : Monday, May 25, 2020 8:26:04 AM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
Hello, Rob.
I found two problems again with Text Expansion.
first:
example: I defined 'test' -> 'hello test'
If I input the character 'test' in the first, It work ok.
But when I input another character before test, the Text Expansion can't work well.
like space before the test: ' test'

Second:
I defined the 'sel' -> 'select * from '
when I type 'sel' in the XShell and under in mysql.
It will be output 'select * from l',
One more character 'l' comes out.
[img]https://sm.ms/image/X1QigxPZTzfWSt4[/img]

The version is StrokesPlus.net_Setup_0.3.8.9
And the Text Expansion is global define.
Rob  
#22 Posted : Saturday, May 30, 2020 3:09:58 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
If this happens consistently, you may want to run the trace version again and paste the log right from the time it's doing these incorrectly.

I can't seem to get it to happen on my end - I use SSMS a lot and also have 'sel' expansion.

Also, is your Windows language Chinese? I'm wondering if it has to do with picking up different character counts for different culture input. Are you able to change Windows to US English and see if it still does the same (just to test)?
kookob  
#23 Posted : Monday, June 1, 2020 2:45:58 AM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
Yes, my windows language is Chinese, And I change to US English, The problem is still happening. So, the problem has nothing to do with the system language!
I recorded some pictures about this problem. You can have a look.
[img]blob:https://imgur.com/228c3072-ec6f-4b54-afa0-d05ec0b82c33[/img]
https://imgur.com/a/mWWkiic
If there's a space in front of it, and I pause a little bit longer, sometimes work ok. For the most part is not ok.

This is log gist log.
https://gist.github.com/kookob/42dee965724645cb62bf0fef3634932e

Rob  
#24 Posted : Tuesday, June 2, 2020 12:02:07 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
For the 'test' example, it appears to be due to space not being a trigger in Options > Text Expansion.

In this configuration, when a space is pressed it is not clearing the token, so it is looking for ' test' instead of 'test' and there is no match. This was intentional, though I can see that while some people may want to have a space in the token, it can cause unexpected behavior. That's why in your NP++ example, the last one works because you pressed tab then 'test' without a space.

I will have to think about it some and make an update, it will probably be a new option if space is not a trigger to treat a space as a token reset.

Edit: I did add the space reset token option in 0.3.9.0, but it's not an automatic update, so you'll need to get it from the Download page directly.

--

For XShell, I cannot reproduce that one, so I'm not sure - but I don't have MySQL installed. Does it do the same thing for just the cmd prompt (inside XShell or at the standard Windows Command Prompt), or it is only when mysql is active?

Edited by user Tuesday, June 2, 2020 2:52:58 PM(UTC)  | Reason: Not specified

kookob  
#25 Posted : Tuesday, June 2, 2020 9:02:09 PM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
For XShell, Only happen in already connected mysql.
In the cmd and xshell ssh mode is work ok.

Look forward to your improvement.
Thank you!
Rob  
#26 Posted : Wednesday, June 3, 2020 12:26:32 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Okay, I will have to install mysql and try.

Also, I did add the space reset in 0.3.9.0, but it's not an automatic update due to other big additions which need testing. But you can go to the download page and get it.
Rob  
#27 Posted : Wednesday, June 3, 2020 1:05:07 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
I installed MySQL, but I can't get it to start in Xshell, just using 'mysql -u root -p' - pressing enter just gives me a new line. The same command line works fine in CMD prompt.

Granted, I don't do SSH stuff at all, so I am probably just not doing something correctly.
kookob  
#28 Posted : Wednesday, June 3, 2020 2:22:13 AM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
Maybe need to SSH in to the server to connect to mysql.
Not directly in the interface of xshell.
So if you don't install mysql on ths ssh server, you might have trouble testing it.
Rob  
#29 Posted : Wednesday, June 3, 2020 3:13:38 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
My guess is that it is due to a delay in the sending/receiving of the characters with the SSH server?

The code is doing this on token match:

- Send SPACE
- Send LEFT
- Send DELETE
- Send BACKSPACE for length of token

I think I needed to add the space/left/delete to address issues with auto-complete popups in certain applications. But imagine the SPACE is sent but is not yet returned from the SSH (again, I am not familiar with this stuff at all) it sends the LEFT key before the space was added to the command line, it would result in the caret being moved back one character, which would explain the result you're seeing.

My guess is that it is backspacing one more character than expected due to this, you might test that out. Or, it might be backspacing the SPACE by the time it comes back from the server?

I will need to think about this to see what makes sense, but it might simply have to be an optional added delay between the key events to allow time for the remote host to respond. I could make this at the text expansion level so it doesn't affect everyone.
kookob  
#30 Posted : Thursday, June 4, 2020 2:20:26 AM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
This problem only happens in ssh connect mysql.
I test it in ssh connect redis(Redis also has automatic completion). It is not happen.
And I with Intellij IDEA Terminal to ssh the service and login mysql, It will happen too.
So this problem is not relationship with XShell.
The problem is hard to locate.
But it doesn't matter. It's not a big deal.
Thanks.
Rob  
#31 Posted : Thursday, June 4, 2020 12:39:52 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Go to Downloads page, scroll to bottom, and enter 0.3.9.2 to download a small test update.

After installing, execute this script to turn off the SPACE, LEFT, DELETE before sending backspaces, let me know what happens; especially what happens in other apps.

Make sure the Settings window is closed when this script is executed, otherwise the temporary settings held in the window (where this is false) will overwrite on Apply/OK.
After being saved, it will persist on reload, etc.

Code:
sp_config.DisableSendSpaceLeftDeleteOnTextExpansionMatch = true;
sp_config.Save();
kookob  
#32 Posted : Thursday, June 4, 2020 4:07:44 PM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
I had install 0.3.9.2.
Do you want me to test like below?
UserPostedImage

UserPostedImage
Rob  
#33 Posted : Thursday, June 4, 2020 4:21:48 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Oh for the script, no just execute it somewhere else, like a hotkey or a gesture that you just run once. It's just to save the setting, like a checkbox in options. It doesn't need to be executed each time.

In fact, just put sp_config.DisableSendSpaceLeftDeleteOnTextExpansionMatch = true; in your Global Actions > Load/Unload > Load script so it sets it on load, then you can change to false and reload if you want to set it back to the default.

Then test the sel in mysql. If it's still doing the same thing (extra letter), download 0.3.9.2 again (I just added another hidden setting) and add this to your load script:

sp_config.TextExpansionClearTokenDelay = 100; //milliseconds before clearing the token

That will add a small pause before clearing the token, I'm thinking there's just a slight delay in the response echoing (from the server) the character in the terminal and a small delay may give it the time it needs.

Rob  
#34 Posted : Thursday, June 4, 2020 5:02:30 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Actually, remove the scripts I posted recently.

Download 0.3.9.2 again, I've added them as options to the Options > Text Expansion section.

So try to add a long delay before clearing token, like 500 just to see if mysql doesn't do the same thing. If that works, then reduce the number until it is low enough to always work, but not be annoying with delay.

If it doesn't work, also try checking the Disable Space, Left, Delete on Match option as well.
kookob  
#35 Posted : Friday, June 5, 2020 2:38:40 AM(UTC)
kookob

Rank: Member

Reputation:

Groups: Approved
Joined: 7/4/2019(UTC)
Posts: 24
China
Location: fujian

Thanks: 1 times
I installed the new version 0.3.9.2.
And Set delay before clearing token with 500, It without any help!

And in my Global Actions > Load/Unload > Load enable the script:
Quote:
sp_config.DisableSendSpaceLeftDeleteOnTextExpansionMatch = true;
sp_config.Save();

It without any help too!
Rob  
#36 Posted : Friday, June 5, 2020 1:25:40 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Well, I just don't know... Confused
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.