https://github.com/dukecat0/keypress
Simulates key press in Swift on macOS.
https://github.com/dukecat0/keypress
keyboard keypress macos swift swift-library
Last synced: 10 months ago
JSON representation
Simulates key press in Swift on macOS.
- Host: GitHub
- URL: https://github.com/dukecat0/keypress
- Owner: dukecat0
- License: mit
- Created: 2021-11-24T09:17:34.000Z (over 4 years ago)
- Default Branch: Main
- Last Pushed: 2022-05-27T10:12:21.000Z (about 4 years ago)
- Last Synced: 2024-12-01T15:44:40.748Z (over 1 year ago)
- Topics: keyboard, keypress, macos, swift, swift-library
- Language: Swift
- Homepage:
- Size: 18.6 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# keypress
Simulates key press in Swift on macOS.
## Usage
Pressing key A:
```swift
import keypress
keypress.press("A")
```
Simulating the typing of the following text:
```swift
keypress.write("Hello World")
```
Pressing hotkey Command+A:
```swift
keypress.hotkey("Command", "A")
```
## Add to your project
Add the following line to the `dependencies` in `Package.swift`:
```swift
.package(url: "https://github.com/meowmeowmeowcat/keypress", from: "0.0.4"),
```