3 ms·
This will not show you as active. Teams and Slack and check the presence of HID events. If you have Xcode/swift installed you can script this instead: #!/
by fingerlocks 2y ago
This will not show you as active. Teams and Slack and check the presence of HID events.
If you have Xcode/swift installed you can script this instead:
#!/usr/bin/swift
import Foundation
import AppKit
let source = CGEventSource(stateID: CGEventSourceStateID.hidSystemState)
CGEvent(keyboardEventSource: source, virtualKey: 0x37, keyDown: true)?.post(tap: .cghidEventTap)
CGEvent(keyboardEventSource: source, virtualKey: 0x37, keyDown: false)?.post(tap: .cghidEventTap)
This simulates one press/depress of the command key (0x37). The rest of the key codes can be found in Events.h in the location of your MacOS SDK library (deep in Xcode usually).
Add it to a cron job or whatever.
- loco5niner 2y agoBut that isn't the goal. Keeping the computer from going to lock screen is.
- fingerlocks 2y agoThis will also do that. It has the same effect as tapping a key repeatedly