StrokesPlus.net Forum
»
General Discussion
»
General Discussion
»
Stroke: Distinguish action based on text field or not
Rank: Advanced Member
Groups: Approved
Joined: 10/26/2020(UTC) Posts: 50 Location: Darmstadt Thanks: 15 times Was thanked: 2 time(s) in 2 post(s)
|
Hi,
I have defined a stroke gesture for my browser with keypress "Backspace" as the action. In earlier times, browsers did support this key as "History back" if the cursor was not in a text field, otherwise it deletes the leftmost character as in every other text editor. Although Firefox still supports this behaviour after changing the default (about:config --> browser.back_action = 0), I fear this won´t last forever (and Chrome already does not support it) and I´d like to find out how I can programmatically distinguish these cases to keep both possibilities in the future. Any ideas, anyone?
Thanks, Rob Otter
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,349 Location: Tampa, FL Thanks: 28 times Was thanked: 416 time(s) in 354 post(s)
|
It will be challenging since there's no definitive (or easy, at least) way that I know of to determine if a text field is active and awaiting input. For apps that use standard Windows controls it's fairly simple, but browsers do not. Are just wanting to make a gesture to navigate back? Or is this more conditional, like you don't want to navigate back if a text field has focus? If you only want a universal back function, this should work fine: Code:sp.SendVKey(vk.BROWSER_BACK);
|
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 10/26/2020(UTC) Posts: 50 Location: Darmstadt Thanks: 15 times Was thanked: 2 time(s) in 2 post(s)
|
Originally Posted by: Rob It will be challenging since there's no definitive (or easy, at least) way that I know of to determine if a text field is active and awaiting input. For apps that use standard Windows controls it's fairly simple, but browsers do not. I feared that, as I also haven´t found an easy way... Originally Posted by: Rob Are just wanting to make a gesture to navigate back? Or is this more conditional, like you don't want to navigate back if a text field has focus? The latter - I use the same gesture for navigating back or backspacing a text, currently with the same key press. In the future, I guess I need to distinguish both cases to send either command.
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,349 Location: Tampa, FL Thanks: 28 times Was thanked: 416 time(s) in 354 post(s)
|
|
1 user thanked Rob for this useful post.
|
|
|
Rank: Advanced Member
Groups: Approved
Joined: 10/26/2020(UTC) Posts: 50 Location: Darmstadt Thanks: 15 times Was thanked: 2 time(s) in 2 post(s)
|
Oh, that´s great, I wasn´t aware of its existence. Works like a charm!
|
|
|
|
StrokesPlus.net Forum
»
General Discussion
»
General Discussion
»
Stroke: Distinguish action based on text field or not
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