This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Feature Updates
 Requests
 Ignore Key with complete deactivation of Strokes
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Christopher

10 Posts

Posted - 06/18/2017 :  18:38:37  Show Profile
Hello Rob,

I am using ScrollNavigator (SN) for my Trackball which gives me a mouse scroll feature. When I have StrokesPlus activated SN isn't working anymore, receiving no input. The Ignore Key doesn't do the trick, only deactivating StrokesPlus completely does.

Could you change the Ignore Key to completely deactivate StrokesPlus as long as it is held?

Would be perfect and I think/hope easy to do :)

All the best,
Christopher

Rob

USA
2615 Posts

Posted - 06/19/2017 :  10:50:47  Show Profile  Visit Rob's Homepage
Do you have any of the options in Preferences checked which have "Mouse Wheel" in the description?
Go to Top of Page

Christopher

10 Posts

Posted - 06/22/2017 :  03:52:52  Show Profile
Hi Rob,

sorry for the late reply. I have all "Mouse Wheel" options unchecked. When I use the Ignore Key ScrollNavigator still isn't responding.

All the best,
Christopher
Go to Top of Page

Rob

USA
2615 Posts

Posted - 06/22/2017 :  06:08:07  Show Profile  Visit Rob's Homepage
For all intents and purposes, holding the ignore key does disable S+ from consuming any of the events while the ignore is being held. S+ cannot be completely disabled during this time, or how can it be aware that you're no longer holding the ignore key without also intercepting keyboard input? :)

However, try something as a test to satisfy my curiosity.

Disable or exit S+ completely, then hold the ignore key while trying to use ScrollNavigator.

I have a suspicion that ScrollNavigator might see that you're holding a modifier key and may be ignoring your attempt to scroll. This would make perfect sense from its point of view, since if you're holding a modifier key, it would seem you're trying to do something specific that is outside the realm of ScrollNavigator's purpose.
Go to Top of Page

Christopher

10 Posts

Posted - 06/23/2017 :  13:30:53  Show Profile
Hi Rob,

yeah, you were right! When I tried a different Ignore Key it worked. It had to do with a combination of CTRL + MouseWheel (emulated by SN) and the programs I use. It were these programs that used CTRL in a different manner which "disabled" SN normal scrolling function.

Thanks a lot!
Christopher
Go to Top of Page

Christopher

10 Posts

Posted - 06/27/2017 :  07:50:41  Show Profile
Hi again,

unfortunately I still have some seemingly unsolvalable problems with predefined hotkeys and the MouseWheel in some programs. An easy solution would be a new option of "Enable StrokesPlus" when a predefined Hotkey (CTRL, ALT, SHIFT) is pressed. So it would be the reversed option of the Ignore Key.

This way StrokesPlus would always run in the background and only activated when the hotkey is pressed. This way there also wouldn't be accidental drawings of the Trackball/Mouse Cursor.

What do you think about this? Would this be easy to implement?

All the best,
Christopher
Go to Top of Page

Rob

USA
2615 Posts

Posted - 06/27/2017 :  08:51:06  Show Profile  Visit Rob's Homepage
The issue is that fully disabling S+ means it cannot observe mouse or keyboard events...without being somewhat not disabled. So while one solution may work for you, suddenly it causes a problem for someone else who wants S+ to be completely disabled when they disable S+.

Obviously I have no ill intent towards ScrollNavigator, but I feel that the nature of it and S+ are somewhat always going to be in competition simply based on how they both operate (not on purpose). I believe you could replace ScrollNavigator by using some of the more advanced features of S+, like the scrolling functions outlined here:

http://www.strokesplus.com/forum/topic/416/scrollup-scroll-down

However, as you can imagine, these are often times challenging in certain applications based on the way those applications operate/receive scrolling input. However, I feel that with enough elbow grease, they could all be hashed out, I've just never spent any real time on it beyond getting the most basic stuff put together for the purposes of demonstrating a starting point.

Aside from that, S+ does have a function to disable [acDisable()] and to disable only the next stroke button event [acDisableNext()], but disabling S+ while allowing it to still intercept/observe input is not a true disabling of the application, which is what I'd expect of a utility like this.

Using the really advanced stuff available in S+, I feel confident there's a way to make this work for you, but it would certainly require a good amount of effort on your part, which you may not be interested in.

However, you could use a simple AHK (AutoHotkey) script to post the disable message directly to S+ to toggle it via a hotkey. I don't use AHK so I'm not familiar enough to provide you with an example, but it would basically simulate the event of toggling the Disable StrokesPlus context menu item.

You would simply have the script bound to a hotkey and when pressed, it would just post the same message to the STROKESPLUS (class name) window with the message type of WM_COMMAND (hex 0x0111) and a wParam of 122 (integer, hex 0x7A). That is what Windows posts to S+ when you click that menu item. Then you could enable/disable S+ whenever you wanted via a hotkey that works for you.

Some quick AHK searches yielded these results which should get you quickly on the path:

- Find a window (you'd need to do this to get the handle for the S+ window):
https://stackoverflow.com/questions/10740208/autohotkey-get-list-of-windows-with-a-certain-title
- Post a message to the window:
https://autohotkey.com/docs/misc/SendMessage.htm

But it looks like, based on a cursory analysis, that this AHK line of code may be all that is needed:

PostMessage, 0x0111, 0x7a, , , , ahk_class STROKESPLUS

Go to Top of Page

Noesis

25 Posts

Posted - 06/28/2017 :  03:08:34  Show Profile
Hi Christopher & Rob,
FYI, the above postmessage code has one too many commas after 0x7a, and Christopher if you go this route, the ahk script will need to be running elevated i.e. as admin, or theoretically at least with UI access permissions which is harder to achieve but possible (all assuming you're using the signed version of S+) as it seems S+ isn't registered to accept messages from processes with lower privileges. Anyway, I digress, the code should be:

PostMessage,0x111,0x7a,,,ahk_class STROKESPLUS

which works, well at least it disables S+, however it doesn't toggle the setting, i.e. once disabled it doesn't re-enable the setting. Rob is there a list of messages/params S+ will react to in this regard, I'm thinking there is perhaps a different message or message parameter combo needed to enable/re-enable S+. Currently it can be done with ahk by sending a simulated mouse click to the icon (after determining the icon's position in the tray) but using messages is a lot cleaner IMO.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 06/28/2017 :  03:29:03  Show Profile  Visit Rob's Homepage
Thanks Neosis!

That makes sense about not being able to receive messages from lower privilege processes, though S+ isn't doing that, probably Windows.

Regarding the wParam, the message pump only has one spot for that message/functionality and it's just switch that toggles disabled/enabled based on the current state S+ is in. The left click event on the tray icon itself just does the same thing and successfully toggles:
case WM_LBUTTONUP: 
	PostMessage(hWnd, WM_COMMAND, MAKEWPARAM(ID_ICONPOPUP_DISABLED, 1), 0);

It's very odd that it doesn't work, as it seems like it should be fine. If you manually re-enable after the AHK script firing the first time, does it once again disable when you press the hotkey? Curious if it's getting hung up after the first message somehow.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 06/28/2017 :  03:40:11  Show Profile  Visit Rob's Homepage
Although, upon disabling, S+ does call
ShowWindow(hWnd,SW_HIDE);
It's possible that AHK assumes you don't intend to send a message to a hidden window, so maybe it doesn't find a match based on its internal criteria (look at all visible windows). I could see that making sense from their perspective, in terms of the convenient single line statement being for quick general use.

Maybe there are other AHK functions which would look across all windows regardless of state for match, then use the handle instead.

Of course, it also could be Windows getting in the way and preventing a message from another process being sent to a hidden window, but that would surprise me...though maybe it wouldn't surprise me!
Go to Top of Page

Christopher

10 Posts

Posted - 06/29/2017 :  02:41:35  Show Profile
Hi Rob and Noesis,

wow, thanks for all the support and help!

I tried the AHK solution (with the comma-fix from Noesis) and it works - like Noesis wrote - one time but not a second one. If I afterwards enable StrokesPlus via the left mouse button in the tray the hotkey works again for one time.

In principle this would be the solution that I need. It would be that as long as I press a key in AHK it sends the message to enable/disable and when I release it it sends it again (there is a keywait function in AHK). But maybe this could be implemented directly in StrokesPlus without the hassles of the AHK solution? I mean it is not about a competition between ScrollNagigator and StrokesPlus anymore. Both work fine together. It's just about the modifier-key that, in conjunction with scrolling, toggles some functions in other programs. A.e.: if I disable StrokesPlus via CTRL and use the scrolling of the - now enabled - ScrollNavigator it could be that a different command is send. And there are unfortunately many programs where you can't alter the hotkeys, especially not the ones in regard to the scrolling function.

But I also see a usage for other StrokesPlus users when you always have StrokesPlus running in the background without acting on input untill it is toggled on by a hotkey like CTRL. I sometimes had the problem that I sended a StrokesPlus command accidentaly. Sure this could be worked around by beeing more careful but if I have to press a hotkey to enable StrokesPlus I think no one would ever make an accidental command.

All the best,
Christopher
Go to Top of Page

Noesis

25 Posts

Posted - 06/29/2017 :  08:44:31  Show Profile
Ok, thanks Rob, I didn't consider that the window would be hidden when S+ was disabled, despite it making total sense that it would be. So to toggle via AHK, the code is:

DetectHiddenWindows, On
PostMessage, 0x0111, 0x7A,,,ahk_class STROKESPLUS

Regarding the receiving messages from processes with lower privileges, it's a security thing imposed by Windows, so S+ is doing anything out of the ordinary, Details about it and on how to change it can be found on MSDN by looking at ChangeWindowMessage and/or ChangeWindowMessageEx functions. At least that's what I thought yesterday, when I posted, but looking at it again, I'm skeptical that, WM_COMMAND messages are actually meant to be blocked by this. It seems (starting from win 7) WM_COMMAND messages sometimes need to be sent a little differently in order to get passed through properly, i.e. with the appropriate windows control_hwnd as the lParam, so perhaps that's needed for it to work without elevating the sender. Well that's my guess anyway. I haven't tested it this way as the code I just posted works, when run as admin, but figured I'd leave my additional thoughts in the post for anyone who might be interested.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 06/29/2017 :  08:55:50  Show Profile  Visit Rob's Homepage
Awesome, thanks for the follow up and help, Neo!

Christopher, I do see what you're saying. There are a few reasons I'm not just jumping on making a quick change for this.

1) I'm in a bit of a long sabbatical from S+ development as I have way too many things going on

2) When I do have the time to work on S+, it's going to be directed to the new version I'm working on (except for any critical failures of the existing S+)

3) This is a very specific edge case, in 5-6 years you're the only person to encounter this specific issue. I don't like registering a persistent hotkey if at all possible as I always want S+ to be out of the way if you instruct it to do so

4) This would also require some fundamental changes in the code deep within the heart of the mouse/keyboard engine (for your second part about only activating on a key press), this would require a massive amount of testing and quite possibly introduce a new set of other problems yet to be known

Hopefully this at least takes care of your specific need, and I will keep these things in mind when I work on the new version, if it's feasible and practical.

Rob
Go to Top of Page

Christopher

10 Posts

Posted - 07/04/2017 :  10:07:41  Show Profile
Hi Rob and Noesis,

I really would like to thank both of you so much. Fist of all, Rob for all the support and helpful feedback. And I see your argument. I just hadn't thought that it would be such a big change in the program. But it doesn't has to, because Noesis solution works perfectly fine. So thank you very much Noesis!

Just a small question that is just a cosmetical issue but maybe you know what the problem is. When I toggle StrokesPlus with the AHK hotkey On/Off all the taskbar icons go blanc the second time I use the hotkey. Any idea on this?

The working code (for toggling with F1) is, which is a customized version from here (https://stackoverflow.com/questions/14630842/autohotkey-mouse-down-continue-press-a-key-until-mouse-up):

F1:: ;{
KeyWait, F1, T0.000000000000000001
if (ErrorLevel)
{DetectHiddenWindows, On
PostMessage, 0x0111, 0x7a, , , ahk_class STROKESPLUS
}
KeyWait, F1
{DetectHiddenWindows, On
PostMessage, 0x0111, 0x7a, , , ahk_class STROKESPLUS
}
;}
return

All the best,
Christopher

Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/04/2017 :  11:09:56  Show Profile  Visit Rob's Homepage
Like, they go completely blank, as in the taskbar buttons themselves are gone? Do they stay gone? Is it only the icons that blank (not the whole taskbar button?
Go to Top of Page

Noesis

25 Posts

Posted - 07/05/2017 :  03:24:07  Show Profile
Chris I tried the code you posted, and I don't get the issue you're experiencing. Like Rob is saying need more details other things to consider, is it only the taskbar icons, i.e tray icons (near clock) are fine or also blank, and does it happen if Scroll Navigator is not running (I'm assuming you have it running as that's what you wanted the code for).

Also just a quick clean up of the code you posted as you seem to have some redundant stuff in there that isn't needed for your case (probably won't fix the issue as it doesn't change functionality):

F1::
olddetect := A_DetectHiddenWindows
DetectHiddenWindows, On
PostMessage, 0x0111, 0x7a, , , ahk_class STROKESPLUS
KeyWait, F1
PostMessage, 0x0111, 0x7a, , , ahk_class STROKESPLUS
DetectHiddenWindows, %olddetect%
return
Go to Top of Page

Christopher

10 Posts

Posted - 07/05/2017 :  07:19:31  Show Profile
Hi again,

wow, you really help me a lot, that's really awesome. Thank you for the code cleanup Noesis!

Just the tray icons (near the clock) go blank (not the icons for the windows in the taskbar, I hadn't explained this correctly). It is like a refresh of the whole screen (not just the icons) is happening after the toggle and after that there is only the StrokesPlus icon visible. The refresh also affects other programs (like a.e. Wordpad, where the toolbars are refreshed). When I move the cursor over the now invisible other icons they appear again. It also happens when I close all other programs which are active in the tray and also when I'm just running this script without all my other AHK scripts.

And Rob, the AHK solution works perfectly despite this minor cosmetic issue. But is there a way that StrokesPlus remembers the last state of Enable/Disable? My stardard would be disabled, but everytime I restart, it is enabled by default. Another solution would be to send a F1 (my toggle key) command after startup. But I have no idea how to automate this.

All the best,
Christopher
Go to Top of Page

Christopher

10 Posts

Posted - 07/05/2017 :  07:21:58  Show Profile
Hi again,

wow, you really help me a lot, that's really awesome. Thank you for the code cleanup Noesis!

Just the tray icons (near the clock) go blank (not the icons for the windows in the taskbar, I hadn't explained this correctly). It is like a refresh of the whole screen (not just the icons) is happening after the toggle and after that there is only the StrokesPlus icon visible. The refresh also affects other programs (like a.e. Wordpad, where the toolbars are refreshed). When I move the cursor over the now invisible other icons they appear again. It also happens when I close all other programs which are active in the tray and also when I'm just running this script without all my other AHK scripts.

And Rob, the AHK solution works perfectly despite this minor cosmetic issue. But is there a way that StrokesPlus remembers the last state of Enable/Disable? My stardard would be disabled, but everytime I restart, it is enabled by default. Another solution would be to send a F1 (my toggle key) command after startup. But I have no idea how to automate this.

All the best,
Christopher
Go to Top of Page

Christopher

10 Posts

Posted - 07/05/2017 :  07:29:27  Show Profile
I just found out that the icons also go blank when I click with the left mouse button on the StrokesPlus icon. Very strange.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/05/2017 :  07:33:13  Show Profile  Visit Rob's Homepage
S+ should start with whatever the exit state was, enabled or disabled. However, you can also add acDisable() inside the sp_init function within the Global Lua:
function sp_init()
	acDisable()
end
Regarding the blanking, that's not something I've ever seen...you could try unchecking, under Preferences:
- Keep Gesture Draw Window On Top
- Don't Hide Gesture Draw Window

Those are on by default for performance reasons on older/slower machines with low powered graphics cards, since a full screen transparent window requires alpha blending everything underneath it (even though it's completely blank) and can cause flickering.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000