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

Notification

Icon
Error

Options
Go to last post Go to first unread
berlihingen  
#1 Posted : Wednesday, November 11, 2020 2:19:53 AM(UTC)
berlihingen

Rank: Newbie

Reputation:

Groups: Approved
Joined: 11/10/2020(UTC)
Posts: 7

Was thanked: 1 time(s) in 1 post(s)
Three different questions, so posting in General Discussion:

1. Gesture speed – can't find if this can be adjusted

2. Where can I get info on Options/Advanced
    a) Disable Capture on Full Screen
    b) Disable High Resolution Sleep

3. I'm not a coder of any kind so question is: if it even possible to run js I found (tried myself for Firefox with no success) like:

Code:
// Duplicate the active tab.
  function commandDuplicateTab () {
    return browser.tabs.query({ currentWindow: true, active: true }).then(tabs => {
      return browser.tabs.duplicate(tabs[0].id);
    });
  }


or

Code:
  // Pin or unpin the current tab.
  function commandPinUnpinTab (data) {
    return browser.tabs.query({ currentWindow: true, active: true }).then(tabs => {
      return browser.tabs.update({ pinned: !tabs[0].pinned })
        // Allow the wheel or chord gesture to repeat.
        .then(() => ({ repeat: true }));
    });
  }

Thanks
Rob  
#2 Posted : Wednesday, November 11, 2020 4:03:21 AM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 16 times
Was thanked: 174 time(s) in 151 post(s)
Quote:
1. Gesture speed – can't find if this can be adjusted

I'm assuming you mean how fast gestures are drawn? If so, no there's no adjustment as it is directly related to your mouse speed settings within Windows.


Quote:
2. Where can I get info on Options/Advanced
a) Disable Capture on Full Screen
b) Disable High Resolution Sleep

Disable Capture on Full Screen

Prevents S+ from capturing stroke button down if the application below the mouse cursor is full screen - the window's rectangle is exactly the same size as the screen's rectangle where the window resides. It's basically the same thing as if you held the ignore key (Options > General) before pressing the stroke button, S+ ignores and doesn't capture the mouse to begin recognizing a gesture.

Disable High Resolution Sleep

This relates to when you call sp.Sleep(nn). The high resolution mode uses a LOT more CPU, but is extremely accurate. For example, sp.Sleep(5) will be pretty much exactly 5 milliseconds. With high resolution sleep disabled, sp.Sleep(5) will be dependent on a number of things related to the CPU and Windows version; but likely somewhere between 15 to 60 milliseconds.

From the Change Log, release 0.3.6.0:
Code:
This tells StrokesPlus.net to use the standard Thread.Sleep call instead of a high resolution (accurate)
timer. High resolution requires much more CPU usage during Sleep calls, but is extremely accurate. 
Standard Thread.Sleep calls uses CPU slices and is not predictable or accurate, but is often good enough
for simple delays. However, for macro replaying, the aggregate effect of the standard Thread.Sleep
call not being high resolution can result in noticeably slower overall replay of events when many 
very short duration Sleep calls are made.

A thread on StackOverflow explaining this: https://stackoverflow.co...for-longer-than-expected


Quote:
3. I'm not a coder of any kind so question is: if it even possible to run js I found (tried myself for Firefox with no success) like:

So S+ uses JavaScript within the scripts, however they run in the context of S+, not the browser.

Think of it like two people who live next door to each other, but they are strangers. We both speak the same language, but neither person is willing to let their neighbor inside their house. They can be friendly, and one can ask the other to do something, but the options will be fairly limited; and neither person can know what's inside the other's house nor be able to move an object within the neighbor's house.

This is very intentional, as I'm sure you would not want just any program to be able to inject its own code into the web browser while you're logged into your bank, for example.

For beginners, these kind of things almost always come up in relation to web browsers, since that's a lot of what we use every day - but it applies to nearly all applications.
In general (there are a few very advanced exceptions), you should imagine that S+ can do no more to another app than what you can do with a keyboard and mouse. Meaning, S+ operates outside of other applications and can only access things which the other application allows. Nearly all applications allow you to use the mouse and the keyboard to interact with them, so that's all S+ can do as well.

So when you're looking to accomplish something, think how you would do it with just the mouse and keyboard; if you can accomplish it, then it should be able to be automated within S+.

For example (Chrome), duplicating a tab would require:
Code:
sp.SendModifiedVKeys([vk.LCONTROL], [vk.VK_L]); //Ctrl+L - Focus the address bar
sp.SendModifiedVKeys([vk.LCONTROL], [vk.VK_C]); //Ctrl+C - Copy the URL
sp.SendModifiedVKeys([vk.LCONTROL], [vk.VK_T]); //Ctrl+T - New Tab
sp.SendModifiedVKeys([vk.LCONTROL], [vk.VK_V]); //Ctrl+V - Paste URL
sp.SendVKey(vk.RETURN); // Enter - Navigate to the pasted URL

The best way to gain access to functions internal to the browser is by installing a browser extension which allows you to bind a keyboard shortcut to perform the task, then have S+ send that keyboard shortcut. Browser extensions run inside the browser, which means they are able to do much more than S+ is able to do.

Expanding on my previous analogy:
Browser extensions live next door, speak the same language, and are really good friends with the browser. Extensions are allowed to come into the browser's house and see/do a lot of things, though they cannot do absolutely whatever they want inside the browser's house - only what the browser will allow them to do. While S+ has absolutely no idea what's inside the browser's house and can only knock on the door (as a stranger) and make a request which the browser is willing to do for a stranger.

Someday, I might like to create a browser extension that S+ can communicate with - but with browsers and security changing so often, I'm not sure if it's a good investment of my limited time.

Edited by user Wednesday, November 11, 2020 4:07:20 AM(UTC)  | Reason: Not specified

berlihingen  
#3 Posted : Wednesday, November 11, 2020 4:35:18 AM(UTC)
berlihingen

Rank: Newbie

Reputation:

Groups: Approved
Joined: 11/10/2020(UTC)
Posts: 7

Was thanked: 1 time(s) in 1 post(s)
Quote:
I'm assuming you mean how fast gestures are drawn?

Yup, was thinking of a bit faster movement, but then found the current speed is comfortable on both PCs in use.

Quote:
S+ ignores and doesn't capture the mouse to begin recognizing a gesture.

This sounds appealing, need to review my full-screen usage to decide.

Quote:
Code:

Thanks for the explanation and for the code – works for Firefox too! Well, now I have a clearer perspective on possibilities – much fun ahead 😃
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.