Ethck / Path-of-Accounting

Lookup utility for Path of Exile based on pathofexile.com/trade
GNU General Public License v3.0
103 stars 13 forks source link

Suggestion: change out the w in the alt-w shortcut #104

Closed Heckner closed 4 years ago

Heckner commented 4 years ago

It also uses player skills, so that could be a pain

Jlance999 commented 4 years ago

Hadn't considered that because i'd not tested it in hideout, I can map it to anything and will fix this tonight. In the future we should have support for setting your own hotkeys as well.

Jlance999 commented 4 years ago

After testing in game, I'm not having my skills used when using the hotkey with the program running, this has been an issue for you? The only default hotkey it conflicts with in game is W and it doesn't register when alt+W are pressed if on a valid object for lookup.

Ethck commented 4 years ago

I have had the same issue, but can't remember if I was using my dev exe or not.

Ethck commented 4 years ago

Okay, I've done some more testing. This indeed is a problem even with the latest dev version. With that noted, the issue only appears if HOLD alt for a second then press w. If you press both buttons at the same time, it reacts as expected. Since w is Flame Dash in game for me, my cursor also had to be within the correct range for flame dash.

deathbeam commented 4 years ago
diff --git a/parse.py b/parse.py
index 8af102f..6bf6c32 100644
--- a/parse.py
+++ b/parse.py
@@ -1079,16 +1079,16 @@ def get_clipboard():
 def watch_keyboard(use_hotkeys):
     if use_hotkeys:
         # Use the "f5" key to go to hideout
-        keyboard.add_hotkey("f5", lambda: keyboard.write("\n/hideout\n"))
+        keyboard.add_hotkey("f5", suppress=True, lambda: keyboard.write("\n/hideout\n"))

         # Use the alt+d key as an alternative to ctrl+c
-        keyboard.add_hotkey("alt+d", lambda: hotkey_handler("alt+d"))
+        keyboard.add_hotkey("alt+d", suppress=True, lambda: hotkey_handler("alt+d"))

         # Open item in the Path of Exile Wiki
-        keyboard.add_hotkey("alt+w", lambda: hotkey_handler("alt+w"))
+        keyboard.add_hotkey("alt+w", suppress=True, lambda: hotkey_handler("alt+w"))

         # Open item search in pathofexile.com/trade
-        keyboard.add_hotkey("alt+t", lambda: hotkey_handler("alt+t"))
+        keyboard.add_hotkey("alt+t", suppress=True, lambda: hotkey_handler("alt+t"))

Something like this should work, maybe? But based on this issue: https://github.com/boppreh/keyboard/issues/22 it looks like its supported only on Windows atm, and also not always