-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNumpad_Shortcuts.ahk
75 lines (67 loc) · 2.06 KB
/
Numpad_Shortcuts.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#Requires AutoHotkey v2.0 ; Specifies that this script requires AHK version 2.0
#SingleInstance force ; Ensures only one instance of this script runs at a time
SendMode "Input" ; Makes Send synonymous with SendInput (faster and more reliable)
Persistent ; Keeps script running even after auto-execute section completes
#Include <Lib> ; Include standard library
#include Lib\AutoHotInterception.ahk ; Include the AutoHotInterception library
; #Include "%A_WorkingDir%\V2_Lib.ahk" ; Commented out include
TraySetIcon A_WorkingDir "`\Lib\Numpad.png" ; Sets custom tray icon
; Initialize AutoHotInterception for a specific keyboard
AHI := AutoHotInterception()
; Get keyboard ID for specific vendor/product ID (likely a numpad device)
id1 := AHI.GetKeyboardId(0x32C2, 0x0012, 1)
cm1 := AHI.CreateContextManager(id1)
ToolTip "Interception Enabled" ; Show temporary tooltip when script starts
SetTimer RemoveToolTip, -500 ; Remove tooltip after 500ms
return
#SuspendExempt
NumpadDot:: {
Suspend
; if GetKeyState("Numpad0", P)
}
#SuspendExempt False
; Only activate these hotkeys when the specific numpad is active
#HotIf cm1.IsActive
; Define hotkeys for numpad keys
; Most keys currently just show a tooltip with the key name
; Numpad0::
; Numpad1::
; Numpad2::
; Numpad3::
; Numpad4::
; Numpad5::
Numpad6:: {
Send "^c"
sleep 10
Run 'cmd.exe /k ollama run llama3.1:8b ' A_Clipboard
}
; Numpad7::
; Numpad8::
; Numpad9::
; NumpadDiv (/) runs a Python script that presumably selects a random YouTube video
NumpadDiv:: {
RunWait 'cmd.exe /c python "D:\Programs\AHK\Random-Youtube-Video.py"', , "Hide"
}
; More numpad keys that show tooltips
NumpadMult::
NumpadAdd::
NumpadSub:: ToolTip A_ThisHotkey
; NumpadEnter controls media playback
NumpadEnter::Media_Play_Pause
; Clear tooltips when keys are released
Numpad1 UP::
Numpad2 UP::
Numpad3 UP::
Numpad4 UP::
Numpad5 UP::
Numpad6 UP::
Numpad7 UP::
Numpad8 UP::
Numpad9 UP::
NumpadDot UP::
NumLock UP::
NumpadDiv UP::
NumpadMult UP::
NumpadAdd UP::
NumpadSub UP::
NumpadEnter UP:: ToolTip ""