Skip to content

Commit

Permalink
Added protection against useless function call: do not check touchpad…
Browse files Browse the repository at this point in the history
… status when is NumberPad not activated or Disabling touchpad is not configured via config
  • Loading branch information
ldrahnik committed Mar 16, 2023
1 parent 61e969f commit 4b60f81
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions asus_touchpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ def check_touchpad_status():

is_touchpad_enabled = is_device_enabled(touchpad_name)

if not is_touchpad_enabled and touchpad_disables_numpad and numlock:
if not is_touchpad_enabled:
numlock = False
deactivate_numpad()
log.info("Numpad deactivated")
Expand All @@ -1472,7 +1472,8 @@ def check_system_numlock_status():

def check_touchpad_status_endless_cycle():
while True and getting_device_status_failure_count < 9:
check_touchpad_status()
if touchpad_disables_numpad and numlock:
check_touchpad_status()
sleep(0.5)

log.info('Getting Device Enabled via xinput disabled because failed more then: \"%s\" times in row', getting_device_status_failure_count)
Expand Down

0 comments on commit 4b60f81

Please sign in to comment.