You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm in the process of making a feature I've been thinking about for a long time: Forced Numpad. (Edit: Renamed to "Mac Numpad").
On a Mac, the numeric keypad is always a numeric keypad, and the Numlock key is "Clear" (Escape key), used for clearing the display of a calculator app. I think you can actually toggle real Numlock on a Mac with Fn+Numlock. I'll use Option+Numlock (physical Super+Numlock, logical Alt+Numlock on a PC keyboard) as a toggle to turn this "Forced Numpad" feature on and off, but we can also support Fn+Numlock for Apple keyboards where Kinto can actually "see" the Fn key.
This maps onto the non-keypad keys for Linux because GTK apps may not interpret the keys as numbers otherwise.
Here is a working version of this for Linux. Will post a Windows/AHK version when I get a chance to put it together, and then combine them into a PR.
#################################################################### START OF MAC NUMPAD FEATURE ####################################################################### Force the numpad to always be a numpad, like a Mac keyboard on macOS# Numlock key becomes "Clear" key for use with calculator (sends Escape)# Toggle feature on/off with Option+Numlock (Fn+Numlock might work on Apple keyboards)# Set _mac_numpad var to "False" (no quotes) to disable by default_mac_numpad=True_mac_numpad_first_run=Truedefmac_numpad_alert():
global_mac_numpad_first_runif_mac_numpad:
run('notify-send -u critical ALERT "Kinto Mac Numpad is now ENABLED.\\rNumlock == Clear (Escape)\\rDisable with Option+Numlock."', shell=True)
print("(DD) Kinto Mac Numpad is now ENABLED.", flush=True)
# Don't show pointless alert on startup if feature is set to be disabled by defaultifnot_mac_numpadandnot_mac_numpad_first_run:
run('notify-send ALERT "Kinto Mac Numpad is now DISABLED.\\rRe-enable with Option+Numlock."', shell=True)
print("(DD) Kinto Mac Numpad is now DISABLED.", flush=True)
_mac_numpad_first_run=Falsemac_numpad_alert()
deftoggle_mac_numpad():
"""Toggle the value of the _optspecialchars variable"""fromsubprocessimportrundef_toggle_mac_numpad():
global_mac_numpad_mac_numpad=not_mac_numpadmac_numpad_alert()
return_toggle_mac_numpaddefine_keymap(lambdawm_class: wm_class.casefold() notinremotes,{
C("Alt-Numlock"): toggle_mac_numpad(),
C("Fn-Numlock"): toggle_mac_numpad(),
},"Mac Numpad toggle")
define_keymap(lambdawm_class: wm_class.casefold() notinremotesand_mac_numpadisTrue,{
C("KP1"): C("1"),
C("KP2"): C("2"),
C("KP3"): C("3"),
C("KP4"): C("4"),
C("KP5"): C("5"),
C("KP6"): C("6"),
C("KP7"): C("7"),
C("KP8"): C("8"),
C("KP9"): C("9"),
C("KP0"): C("0"),
C("KPDot"): C("Dot"),
C("Numlock"): C("Esc"),
},"Mac Numpad")
################################################################## END OF MAC NUMPAD FEATURE ####################################################################
The text was updated successfully, but these errors were encountered:
I'm in the process of making a feature I've been thinking about for a long time: Forced Numpad. (Edit: Renamed to "Mac Numpad").
On a Mac, the numeric keypad is always a numeric keypad, and the Numlock key is "Clear" (Escape key), used for clearing the display of a calculator app. I think you can actually toggle real Numlock on a Mac with Fn+Numlock. I'll use Option+Numlock (physical Super+Numlock, logical Alt+Numlock on a PC keyboard) as a toggle to turn this "Forced Numpad" feature on and off, but we can also support Fn+Numlock for Apple keyboards where Kinto can actually "see" the Fn key.
This maps onto the non-keypad keys for Linux because GTK apps may not interpret the keys as numbers otherwise.
Here is a working version of this for Linux. Will post a Windows/AHK version when I get a chance to put it together, and then combine them into a PR.
The text was updated successfully, but these errors were encountered: