def check_num_lock(*args): display = Xlib.display.Display() gkc = display.get_keyboard_control() if gkc.led_mask & 2 == 2: logging.warning('NumLock is on; your bindings may not work')
def check_num_lock(*args): display = Xlib.display.Display() gkc = display.get_keyboard_control() if gkc.led_mask & 2 == 2: print 'WARNING: NumLock is on; your bindings may not work.'