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

Notification

Icon
Error

Options
Go to last post Go to first unread
liuxilu  
#1 Posted : Monday, May 18, 2020 1:10:32 PM(UTC)
liuxilu

Rank: Advanced Member

Reputation:

Groups: Translators, Moderators, Approved
Joined: 4/6/2020(UTC)
Posts: 79
China

Thanks: 1 times
Was thanked: 21 time(s) in 21 post(s)
It is more efficient and stable to get infos via hook, not timers; control the input via hook, not 'consume' & sendkey.
Considering script is significantly slower for hooks, S+ would use the plugin directly via managed codes.
For example, the plugin can subscribe an event raised in hook procedures. Furthermore, actions and hotkeys could have events as well.
Rob  
#2 Posted : Monday, May 18, 2020 4:53:05 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 419 time(s) in 356 post(s)
Quote:
control the input via hook, not 'consume' & sendkey

The problem with this is that low level hooks have to be processed and returned to Windows as fast as possible. If the hook call does not return quickly enough, Windows will evict (remove) the hook, taking it out of the call chain without notifying the application (S+).

Opening it up to plug-ins could result in Windows evicting the hook(s); an event subscription model really is not ideal for this scenario. Plus, people writing poor plug-ins or simply having too many plug-ins subscribing to the events could lead to delays, again causing Windows to evict the hook(s). Not only that, poorly written plug-ins could impact the amount of interference of mouse/keyboard input to the point where the user can tell mouse/keyboard events have a slight delay as the plug-in(s) are processing each event (there are a LOT of hook events/messages).

Now, an asynchronous subscription model would be fine, but you would not be able to control the return value of the hook calls made by Windows - it would be notify only, unable to prevent the event from being passed along to the OS/applications.
liuxilu  
#3 Posted : Tuesday, May 19, 2020 7:36:15 AM(UTC)
liuxilu

Rank: Advanced Member

Reputation:

Groups: Translators, Moderators, Approved
Joined: 4/6/2020(UTC)
Posts: 79
China

Thanks: 1 times
Was thanked: 21 time(s) in 21 post(s)
I see. Notify only is also great. And how about hotkeys?
Users browsing this topic
Guest
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.