Rank: Advanced Member
Groups: Approved
Joined: 11/10/2020(UTC) Posts: 30
Was thanked: 1 time(s) in 1 post(s)
|
I tried and I failed (not a coder after all) so would appreciate any help. The idea is: a common gesture (right to left) that emulates the BACK button changes this to the BACKSPACE when gets cursor state "blinking text cursor" (or whatever name it is) and then goes back to the BACK for any other cursor state (including "unknown"). Is it even possible? Thanks.
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,332  Location: Tampa, FL Thanks: 28 times Was thanked: 413 time(s) in 353 post(s)
|
So this works for me, however note that this only works if the mouse cursor is the IBeam style - which usually means the mouse cursor needs to be over the text/typing area and visible (I can't remember, but I think I may have my mouse cursor set to not hide when typing). Code:if(sp.GetCurrentMouseCursor() == "IBeam") {
sp.SendVKey(vk.BACK);
} else {
sp.SendVKey(vk.BROWSER_BACK);
}
Unfortunately, in web browsers (and a lot of apps), S+ can't determine if you're in an active text input field (blinking input cursor [caret]) - at least, not that I'm aware of. This will allow you to test if the standard Windows API is able to get the location of the caret (keyboard cursor) and log it to the S+ Console User tab - but it only works on native Windows input controls, which many apps these days do not use: Code:var cp = sp.GetCaretLocation();
if(cp) {
StrokesPlus.Console.Log(`Caret Location (X,Y): ${cp.X},${cp.Y}`);
} else {
StrokesPlus.Console.Log("No caret location found");
}
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 11/10/2020(UTC) Posts: 30
Was thanked: 1 time(s) in 1 post(s)
|
For now, I checked places where I wanted this functionality (OneNote app; online translation sites in Edge and Waterfox browsers), and this works perfectly. Thank you very much!
|
|
|
|
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.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close