https://github.com/adhami3310/reflex-global-hotkey
Global Hotkey Watcher for Reflex
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (2.5%) to scientific vocabulary
Repository
Global Hotkey Watcher for Reflex
Basic Info
- Host: GitHub
- Owner: adhami3310
- Language: Python
- Default Branch: main
- Size: 190 KB
Statistics
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Reflex Global Hotkey Watcher
Listens to hotkeys in the global scope and calls event handler as necessary.
```python from reflexglobalhotkey import globalhotkeywatcher
class State(rx.State): lastkeypressed: str = ""
def on_key(self, keyname: str):
self.last_key_pressed = keyname
def index(): return rx.fragment( State.lastkeypressed, globalhotkeywatcher( onkeydown=State.on_key ) ) ```
You can special case on the event key:
python
global_hotkey_watcher(
on_key_down=lambda key_name: rx.cond(
rx.Var.create(
["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]
).contains(key_name),
State.on_key(key_name),
rx.console_log("Invalid key!"),
)
)
You can also special case on the second parameter:
```python from reflexglobalhotkey import globalhotkeywatcher from reflex.event import KeyInputInfo
class State(rx.State): lastkeypressed: str = ""
def on_key(self, keyname: str, keyinfo: KeyInputInfo):
if not keyinfo["alt_key"]:
self.last_key_pressed = keyname
def index(): return rx.fragment( State.lastkeypressed, globalhotkeywatcher( onkeydown=State.on_key ) ) ```
The fields are defined in reflex.event:
```python class KeyInputInfo(TypedDict): """Information about a key input event."""
alt_key: bool
ctrl_key: bool
meta_key: bool
shift_key: bool
```
Owner
- Name: Khaleel Al-Adhami
- Login: adhami3310
- Kind: user
- Location: Cambridge, MA
- Company: MIT
- Website: https://adhami.me
- Repositories: 26
- Profile: https://github.com/adhami3310
support my work on https://opencollective.com/beyond-expiry
GitHub Events
Total
- Create event: 3
- Issues event: 1
- Release event: 1
- Watch event: 2
- Push event: 9
Last Year
- Create event: 3
- Issues event: 1
- Release event: 1
- Watch event: 2
- Push event: 9
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- PaulBryanCo (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 8,925 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 7
- Total maintainers: 1
pypi.org: reflex-global-hotkey
Global Hotkey Watcher for Reflex
- Documentation: https://reflex-global-hotkey.readthedocs.io/
- License: MIT
-
Latest release: 1.2.3
published about 1 year ago
Rankings
Maintainers (1)
Dependencies
- alembic 1.14.0
- annotated-types 0.7.0
- anyio 4.6.2.post1
- async-timeout 5.0.0
- backports-tarfile 1.2.0
- bidict 0.23.1
- build 1.2.2.post1
- certifi 2024.8.30
- cffi 1.17.1
- charset-normalizer 3.4.0
- click 8.1.7
- colorama 0.4.6
- cryptography 43.0.3
- distro 1.9.0
- docutils 0.21.2
- exceptiongroup 1.2.2
- fastapi 0.115.4
- greenlet 3.1.1
- gunicorn 23.0.0
- h11 0.14.0
- httpcore 1.0.6
- httpx 0.27.2
- idna 3.10
- importlib-metadata 8.5.0
- jaraco-classes 3.4.0
- jaraco-context 6.0.1
- jaraco-functools 4.1.0
- jeepney 0.8.0
- jinja2 3.1.4
- keyring 25.5.0
- lazy-loader 0.4
- mako 1.3.6
- markdown-it-py 3.0.0
- markupsafe 3.0.2
- mdurl 0.1.2
- more-itertools 10.5.0
- nh3 0.2.18
- packaging 24.1
- pip 24.3.1
- pipdeptree 2.16.2
- pkginfo 1.10.0
- platformdirs 4.3.6
- psutil 6.1.0
- pycparser 2.22
- pydantic 2.9.2
- pydantic-core 2.23.4
- pygments 2.18.0
- pyproject-hooks 1.2.0
- python-dateutil 2.9.0.post0
- python-engineio 4.10.1
- python-multipart 0.0.17
- python-socketio 5.11.4
- pywin32-ctypes 0.2.3
- readme-renderer 44.0
- redis 5.2.0
- reflex 0.6.4
- reflex-chakra 0.6.2
- reflex-hosting-cli 0.1.13
- requests 2.32.3
- requests-toolbelt 1.0.0
- rfc3986 2.0.0
- rich 13.9.4
- secretstorage 3.3.3
- setuptools 75.3.0
- shellingham 1.5.4
- simple-websocket 1.1.0
- six 1.16.0
- sniffio 1.3.1
- sqlalchemy 2.0.36
- sqlmodel 0.0.22
- starlette 0.41.2
- starlette-admin 0.14.1
- tabulate 0.9.0
- tomli 2.0.2
- tomlkit 0.13.2
- twine 5.1.1
- typer 0.12.5
- typing-extensions 4.12.2
- urllib3 2.2.3
- uvicorn 0.32.0
- websockets 13.1
- wheel 0.44.0
- wrapt 1.16.0
- wsproto 1.2.0
- zipp 3.20.2
- python ^3.10
- reflex ^0.6.4