Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Left arrow triggers cooldown even though it is not mapped #10

Open
Tschis opened this issue Jan 27, 2019 · 9 comments
Open

Left arrow triggers cooldown even though it is not mapped #10

Tschis opened this issue Jan 27, 2019 · 9 comments

Comments

@Tschis
Copy link

Tschis commented Jan 27, 2019

As you can see I don't have any arrow mapped, but it still triggers red timer.
image

@krolikson
Copy link

Strong ICE is on "4." That why.

@krolikson
Copy link

You using it on laptop right? It's problem with num navigation keys which are sticked in vk to arrow keys. I trying to find solution but it not easy :))

@Tschis
Copy link
Author

Tschis commented Jan 28, 2019

Thanks for the reply! But I am not on laptop, on PC using a full size mechanical keyboard.

@krolikson
Copy link

I using tenless keyboard on my laptop. Anyone know how to remove vk sticky keys.
Numpadup = 8 is sticky to arrow up,
numpaddown = 2 sticky to arrow down,
Numpadright = 6 arrow left and numpadleft = 4 sticky to arrow right. Python catching output from both keyboard i think, that why script trigger spells on arrow keys.

@krolikson
Copy link

I tried to suppress, remap and other thinks but it not help. Any solution?

@krolikson
Copy link

krolikson commented Feb 11, 2019

I was wrong about Python x64 library. Issue is in embbeded keys on keyboard which are installed with kB or Motherboard drivers, i, m not 100% sure which one of does two.
For example: navi keys on numpad (numpad arrows) are sticky to "normal keys" ( numpad 8 is stick to numerical key "8" and to arrow key "UP" also in some kB layouts, have special signs like (', ", *, /, etc.) which are displayed when we Press key" 8" with some modifier like Shift, Alt etc.
I think the problem is with Hook keyboardEvents when on PC we have running ACPI keyboardEvents(embbeded keys) like it is on laptop keyboard(fn keys)
When we using keyboard Hook in Python we Hook all keyboard keys and keyboard events from Our OS (fn, special, sticky keys etc). If we Press, for example on laptop keyboard, key "4" - the input look like /'4', 'left', 'u', '$'/ We need to put some kind of filter (like it is in Windows) to catch only simple key(mayby scan_code? ), not "all keys and events" on pressed key.
Off course it is few other ways to solve it.
We can "flush" all sticky keys by redis (editing database by ~jupyter) or remove sticky key by "kbdedit" but you need to pay for this software.
I found one more way to solve it. You just need to remap your numerical keys (2,4,6,8) but it isn't good solution :P
On my laptop, now it's look like that:
First key on my keyboard it ESC so:
// ESC, F1, F2, F3, F4,F5,F6,F7,F8........
// ~ , 1, : , 3, $, 5, -, 7, #, 9, 0...
// Q, W, E.........
At this moment it is fastest and easiest solution.
If i have some free time i Will make extra file with filter. Cheers :)

@krolikson
Copy link

Just add new file into cooldown-overlay folder by python. Name it arrow.py. Into cd-overlay.py you need write new line under "from classes import * " add import arrow. Save and run :)

import keyboard
import time

def callback(state):
print(state)

key = "up"
key1 = "down"
key2 = "left"
key3 = "right"

upObject = keyboard.add_hotkey(key.upper(), callback, args=(),suppress=True,timeout=1,trigger_on_release=False)
downObject = keyboard.add_hotkey(key.lower(), callback, args=(0,),suppress=True,timeout=1,trigger_on_release=False)

upObject = keyboard.add_hotkey(key1.upper(), callback, args=(),suppress=True,timeout=1,trigger_on_release=False)
downObject = keyboard.add_hotkey(key1.lower(), callback, args=(0,),suppress=True,timeout=1,trigger_on_release=False)

upObject = keyboard.add_hotkey(key2.upper(), callback, args=(),suppress=True,timeout=1,trigger_on_release=False)
downObject = keyboard.add_hotkey(key2.lower(), callback, args=(0,),suppress=True,timeout=1,trigger_on_release=False)

upObject = keyboard.add_hotkey(key3.upper(), callback, args=(),suppress=True,timeout=1,trigger_on_release=False)
downObject = keyboard.add_hotkey(key3.lower(), callback, args=(0,),suppress=True,timeout=1,trigger_on_release=False)

upObject = keyboard.add_hotkey(key3.upper(), callback, args=(1,),suppress=True,timeout=1,trigger_on_release=False)
downObject = keyboard.add_hotkey(key3.lower(), callback, args=(0,),suppress=True,timeout=1,trigger_on_release=False)

time.sleep(2)
keyboard.remove_hotkey(upObject)
keyboard.remove_hotkey(downObject)

@krolikson
Copy link

Arrows nevermore triggger spells which are assigned to digit's keys

@eduardorost
Copy link

I fixed this problem with this code.

def triggerByKey(self):
	#print(self.labelText + " triggered by Key")

	# pressed by arrow, skip becaus down arrow trigger hotkey 2
	if keyboard.is_pressed('up') or keyboard.is_pressed('down') or keyboard.is_pressed('left') or keyboard.is_pressed('right'):
		return

	if self.useType == UseType.TARGET:
		self.setTrigger()
		
	if self.useType == UseType.CROSSHAIR: 
		self.arm()

it seems working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants