Author Topic: Hook not showing/logging events  (Read 2655 times)

0 Members and 1 Guest are viewing this topic.

StarScream

  • Jr. Member
  • **
  • Posts: 4
  • Karma: 1
    • View Profile
Hook not showing/logging events
« on: September 06, 2013, 06:43:39 PM »
Hello.

I can't for the life of me get the Hook plugin to work. My goal is to make it so a button on my remote can turn Vox on (or off), so I can turn it back on after I've turned it off with my voice.

After poking around in the Plugin and not understanding anything, I finally came across this post and started following along: http://voxcommando.com/forum/index.php?topic=1037.0

I have a Logitech Harmony Remote and mapped to buttons with the keys "~" and "!". I then enabled the Hooks plugin, restarted Vox, then went into the plugin options and checked "log". I then press the buttons on my remote and they appear in the list. Then I move the two new key-presses over using the button so they appear in the right list and then do a "save all" and restart Vox one more time for good measure.

That takes us to step 14 from that post. I can't get the next step to work; which is show the key-presses in the History when I press the button on my remote. I've tried everything I can think of; even going as far as restarting the entire computer. To test that the remote is sending the key-press, I opened up notepad and placed the cursors inside. Sure enough, when I press the remote buttons the key-presses appear.

Am I doing something wrong?

I'd be grateful for any help anyone could give me.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Hook not showing/logging events
« Reply #1 on: September 06, 2013, 08:07:55 PM »
Start off with this:

- "all keys" selected
- "generate named events" checked
- "key hook enabled" is checked.

Click "save all" on the hook plugin settings.  Don't restart VC after this.

Now test with using a regular keyboard as well as the remote.  You should now see an event appear in the VC history panel for every key press.

If not,  look in the "options" dropdown on the main VC menu to verify that "show all events" is checked.  This is the default, but it may have been turned off inadvertently.

This version of the plugin has "key hook enabled" unchecked by default when you start VC so you need to use an action to turn hook on when vc starts.  The action to turn it on is "Hook.Enable".

Here is a newer version of the plugin that starts automatically if you save options with keyhook enabled.  Just replace the hook.dll file in the plugins\hook folder with the attached version.
« Last Edit: October 05, 2014, 03:07:39 PM by nime5ter »

StarScream

  • Jr. Member
  • **
  • Posts: 4
  • Karma: 1
    • View Profile
Re: Hook not showing/logging events
« Reply #2 on: September 06, 2013, 11:35:48 PM »
Thanks so much for the quick and helpful reply!

I'm a dummy, and I didn't even see/notice the "Show All Events" option - I hunted around for ever for something I was missing too. Haha, ah well... once enabled, I now see the key-presses in the history and I was able to drag and drop them into the editor and have it work as expected... sort of (see below).

The issue you described about it having "key hook enabled" unchecked by default doesn't seem to happen to me. When I launch Vox, and press my remote button it works as expected without having to change any settings in the Hook plugin, or firing the "Hook.Enable" action.

Regardless, I updated the plugin to your attached version, thanks for that.

I do however have a different problem:

Sometimes the commands don't respond until I press the button (or keyboard key) a couple times. Furthermore, after a few/bunch of "hooks" from my remote, or keyboard, Vox eventually stops responding to them. I can cycle Vox off/on maybe 3 to 7 times (it varies), with the button/key, before it will no longer respond. After restarting it is back to normal. I feel like the two issues are related. I am using Vox 1.1.0.0 and Hook 0.2.2.0.

At the very least, it kinda works. Better then nothing; that's for sure!
It would, however, be nice to get it 100%.

Thanks for all the help, really love the program.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Hook not showing/logging events
« Reply #3 on: September 07, 2013, 02:30:10 PM »
I'm on the case.  I think I know what the problem is, and I am pretty sure I can fix it.

Stay tuned... :D

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Hook not showing/logging events
« Reply #4 on: September 07, 2013, 03:43:45 PM »
Give this one a shot.  (version 0.3 of the hook plugin is attached to this post)

I recommend you go back to only using "specific keys".  I think you'll be less likely to have issues if you are not generating an event for every single key press.
« Last Edit: October 05, 2014, 03:08:10 PM by nime5ter »

StarScream

  • Jr. Member
  • **
  • Posts: 4
  • Karma: 1
    • View Profile
Re: Hook not showing/logging events
« Reply #5 on: September 08, 2013, 03:26:50 PM »
Works perfectly now! Gets every key-press/button press. I no longer have to press it a couple times before it reacts... and it doesn't appear to have a limit anymore either.

Thanks so much!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Hook not showing/logging events
« Reply #6 on: September 08, 2013, 04:01:31 PM »
No problem, and thanks for bringing the bug to my attention. :D