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

Notification

Icon
Error

Options
Go to last post Go to first unread
Rob Otter  
#1 Posted : Monday, April 12, 2021 10:36:44 AM(UTC)
Rob Otter

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 10/26/2020(UTC)
Posts: 50
Germany
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
Rob  
#2 Posted : Monday, April 12, 2021 3:45:32 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)
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);
Rob Otter  
#3 Posted : Monday, April 12, 2021 5:38:03 PM(UTC)
Rob Otter

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 10/26/2020(UTC)
Posts: 50
Germany
Location: Darmstadt

Thanks: 15 times
Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: Rob Go to Quoted Post
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... Crying

Originally Posted by: Rob Go to Quoted Post
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.

Rob  
#4 Posted : Monday, April 12, 2021 6:06: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)
thanks 1 user thanked Rob for this useful post.
Rob Otter on 4/13/2021(UTC)
Rob Otter  
#5 Posted : Tuesday, April 13, 2021 4:51:04 AM(UTC)
Rob Otter

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 10/26/2020(UTC)
Posts: 50
Germany
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!
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.