Repository navigation
Expand file tree
/
Copy pathstd_os_hooks.smash
More file actions
94 lines (79 loc) · 2.17 KB
/
Copy pathstd_os_hooks.smash
File metadata and controls
94 lines (79 loc) · 2.17 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// std_os_hooks.smash - OS hooks and system-level functionality for SmashLang
/**
* OS hooks module for SmashLang
* Provides access to system-level hooks, signals, and events
*/
// Signal handling
export const signals = {
// Get all available signals
getAvailable: function() {
return __native_get_signals();
},
// Register a handler for a specific signal
register: function(signal, handler) {
return __native_register_signal(signal, handler);
},
// Send a signal to another process
send: function(pid, signal) {
return __native_send_signal(pid, signal);
}
};
// Clipboard operations
export const clipboard = {
// Check if clipboard functionality is available
isAvailable: function() {
return __native_has_clipboard();
},
// Read text from clipboard
read: function() {
return __native_clipboard_read();
},
// Write text to clipboard
write: function(text) {
return __native_clipboard_write(text);
}
};
// Keyboard hooks
export const keyboard = {
// Check if keyboard hook functionality is available
isAvailable: function() {
return __native_has_keyboard_hooks();
},
// Register a handler for keyboard events
register: function(handler) {
return __native_register_keyboard(handler);
}
};
// Mouse hooks
export const mouse = {
// Check if mouse hook functionality is available
isAvailable: function() {
return __native_has_mouse_hooks();
},
// Register a handler for mouse events
register: function(handler) {
return __native_register_mouse(handler);
}
};
// System notifications
export const notifications = {
// Check if notification functionality is available
isAvailable: function() {
return __native_has_notifications();
},
// Send a system notification
send: function(title, message, options = {}) {
return __native_send_notification(title, message, options);
}
};
// File system watchers
export const fileWatcher = {
// Watch a file or directory for changes
watch: function(path, handler) {
return __native_watch_path(path, handler);
},
// Stop watching a file or directory
unwatch: function(path) {
return __native_unwatch_path(path);
}
};