October 12, 20178 yr Hello, is there a way to get keys pressed? I would like to have two "keybinds", to my plugin if it is at all possible?
October 12, 20178 yr Hello, nerver tried but take a look here: it's talking about _hookKeybindingsSpells
October 12, 20178 yr 18 minutes ago, Apexx said: Hello, is there a way to get keys pressed? I would like to have two "keybinds", to my plugin if it is at all possible? Can you explain a little more on what you mean? If you're asking if it's possible to Press a Keybind from a Plugin , the answer is yes. If your question is: Is it possible to click a WoW macro by using a Keybind from a plugin, then answer is yes :).
October 12, 20178 yr Author I would like to have the ability to add or remove the nearest WoW game object to the collections list for my WRadar plugin using hotkeys, like "Shift+Insert" and "Shift+Delete".
October 12, 20178 yr Author I just keep getting the following in log Quote [D] 13:26:25 - [Keyboard Hook] Couldn’t register the hot key.
October 12, 20178 yr Hello, you may decompile my plugin which uses keyboardhook & gui: https://wrobot.eu/files/file/1213-aoebutton/ I hope it's self-explaining, since it's quite old and can't remember anything ;)
October 12, 20178 yr Author I looked into the code and it seems you had used your own form events handling. I am using the WRobot's settings window from inside the class itself. I don't think the InputHook catches anything while the game window has focus. I guess I am trying to catch the even from WRobot directly.
October 12, 20178 yr 19 minutes ago, Apexx said: I looked into the code and it seems you had used your own form events handling. I am using the WRobot's settings window from inside the class itself. I don't think the InputHook catches anything while the game window has focus. I guess I am trying to catch the even from WRobot directly. I initially implemented it, because sometimes i had a bug from WRobot's keyboard class which didn't hooked my keys, dunno if it's fully working now.
October 12, 20178 yr Author Yeah I cannot get WRobot's keyboard class to work either. Seen the examples throughout the forums though. public class Main : IPlugin { private Wradar.InputHook.KeyboardHook _hook; private Keys _keyAdd = Keys.None; private Keys _keyRemove = Keys.None; public void Initialize() { _keyAdd = Keys.F5; _keyRemove = Keys.F6; _hook = new Wradar.InputHook.KeyboardHook(true); // Strange it doesn't work with this set as Global _hook.KeyDown += HookOnKeyDown; _isLaunched = true; } private void HookOnKeyDown(Keys key, bool shift, bool ctrl, bool alt) { Logging.WriteDebug("key = " + key); if (key == _keyAdd) { try { Logging.WriteDebug("Would you like to add ____ object to the collections list?"); } catch (Exception ex) { Logging.WriteError("HookOnKeyDown _keyAdd Error:\n" + ex); } } else if(key == _keyRemove) { try { Logging.WriteDebug("Would you like to remove ____ object from the collections list?"); } catch (Exception ex) { Logging.WriteError("HookOnKeyDown _keyRemove Error:\n" + ex); } } } public void Dispose() { try { if (_hook != null) { _hook.KeyDown -= HookOnKeyDown; _hook.Dispose(); } } catch { } _isLaunched = false; } }
October 13, 20178 yr Do you have look this: https://wrobot.eu/forums/topic/12-how-to-create-an-fight-class-developer-only/?do=findComment&comment=6778
October 13, 20178 yr Author 5 hours ago, Droidz said: Do you have look this: https://wrobot.eu/forums/topic/12-how-to-create-an-fight-class-developer-only/?do=findComment&comment=6778 Yes I did. I have searched and tried everything from the forums that returned anything to do with keyboard events. I will double check the .Net framework version in a bit.
October 13, 20178 yr Author Would it be easier to create a small addon for WoW directly that communicates with the plugin? I don't have much knowledge integrated an addon with WRobot. How would one get/set variables from WRobot plugin data to an addon?
October 14, 20178 yr Author Yeah I don't think KeyboardHook is working. I have tried using Target framework .NET Framework 4.5 as well as other later versions and it still cannot register hot key. I also tried many different variations of hot key combinations.
October 15, 20178 yr On 13/10/2017 at 5:03 PM, Apexx said: Yes I did. I have searched and tried everything from the forums that returned anything to do with keyboard events. I will double check the .Net framework version in a bit. In your code you don't "RegisterHotKey"
October 15, 20178 yr Author No that was code from checking out reapler's project file and trying his Keyboard Hook class. I have attached my log file, and an example plugin that uses the same code found by you on other threads to activate spells via key bind 15 Oct 2017 10H07.log.html KeyboardHook.cs
October 17, 20178 yr readonly KeyboardHook _hookKeybinding = new KeyboardHook(); public InitMethod() { _hookKeybinding.KeyPressed += (object sender, KeyPressedEventArgs e) => { Logging.Write("Key was pressed!"); }; _hookKeybinding.RegisterHotKey(ModifierKeys.Shift, Keys.Insert); } Something like this is not working for you?
October 17, 20178 yr 2 hours ago, Apexx said: No, still not working. Just to be sure, did you call the InitMethod() from your Plugin Initializer?
October 17, 20178 yr Author 13 minutes ago, Avvi said: Just to be sure, did you call the InitMethod() from your Plugin Initializer? Yes, I did.
October 17, 20178 yr Just now, Apexx said: No errors, just the same [Keyboard Hook] Couldn’t register the hot key. Oh damn i had the same problems y.y thats why i switched over to lua ingame detection. This will be a part for Driodz.
October 17, 20178 yr Author Yeah I don't know. I somewhat give up on it for now. People will just have to pause/stop the bot and go to Plugin Settings to add/remove items from the collections list for now. Thanks though, @iMod
Create an account or sign in to comment