https://github.com/auracletech/hotkeys
hotkeys module in TypeScript for hotkeys
https://github.com/auracletech/hotkeys
Last synced: 12 months ago
JSON representation
hotkeys module in TypeScript for hotkeys
- Host: GitHub
- URL: https://github.com/auracletech/hotkeys
- Owner: AuracleTech
- Created: 2024-02-26T01:11:35.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-03T17:25:11.000Z (about 2 years ago)
- Last Synced: 2025-06-30T21:07:17.786Z (12 months ago)
- Language: TypeScript
- Homepage:
- Size: 260 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hotkeys
hotkeys module in TypeScript for easy to add hotkeys
##### Example

##### Requirements
- get `hotkeys.scss` and `hotkeys.ts`
##### Usage
initialization
```typescript
import "../SCSS/hotkeys.scss";
import { Hotkeys } from "./hotkeys.ts";
const hotkeys = new Hotkeys();
```
create a hotkey
```typescript
hotkeys.set({
key: "h",
short: "Toggle Hotkeys",
long: "Toggle the hotkeys modal display",
func: () => hotkeys.toggle_modal(),
experimental: false,
});
```
remove a hotkey
```typescript
hotkeys.remove("h");
```
print keys names available
```typescript
for (const row of Hotkeys.KEYBOARD_KEYS) {
for (const column of row) {
console.log(column);
}
}
```