Skip to main content

Press keyboard 🦍 Get key 🦍 Python Asyncio for Robotics

Project description

Gogo Keyboard

Press keyboard 🦍 Get key 🦍 Unga Bunga

Requirements Compatibility
python
sdl2
mit
asyncio
ROS 2
zenoh

Python Asyncio library to simply get keyboard presses and releases. Gogo Keyboard creates a new independent SDL2 window that captures the key events.

pip install https://github.com/2lian/gogo_keyboard.git[dll]
python3 -m gogo_keyboard.example

Motivation:

  • Keyboard presses and releases in Asyncio.
  • Only when clicking on the Gorilla window.
  • Python terminal is free for other tasks.
  • Based on asyncio_for_robotics for seamless compatibility with:
    • ROS 2
    • Zenoh
    • More
python python python

Installation

This library requires sdl2 and sdl2_image. By specifying the [dll] optional dependency, those will be installed by pip.

pip install gogo_keyboard[dll]

Conda pacakge: soon!

Python Example

Example is provided here and can be run with python3 -m gogo_keyboard.example.

Here is a minimal piece of working code:

import asyncio
from gogo_keyboard.keyboard import KeySub

async def async_main():
    key_sub = KeySub()
    async for key in key_sub.listen_reliable():
        print(key)

asyncio.run(async_main())

ROS 2 Example (Humble, Jazzy, Kilted)

A very simple ROS 2 node is provided here, run it with python3 -m gogo_keyboard.ros_node. The messages format is a json formatted String, 🦍 simple 🦍 Unga Bunga.

Zenoh Example

A very simple Zenoh publisher is provided here, run it with python3 -m gogo_keyboard.zenoh_node. The messages format is a json formatted String, 🦍 simple 🦍 Unga Bunga.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gogo_keyboard-1.0.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gogo_keyboard-1.0.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file gogo_keyboard-1.0.0.tar.gz.

File metadata

  • Download URL: gogo_keyboard-1.0.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for gogo_keyboard-1.0.0.tar.gz
Algorithm Hash digest
SHA256 477e38d71724f03804f191a52a1eff0d935288dbe2e5e764e50e745d530cebd7
MD5 45c76ef65d5b3a1e7230737da8d0c607
BLAKE2b-256 1e0760cc095d9a535fd6d212b7a4f5bef81a6aa89dd173288c52a3fb503f07ad

See more details on using hashes here.

File details

Details for the file gogo_keyboard-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gogo_keyboard-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 febfec28fda5aadf7b6fe15e02b1e4e367763f6ac8252cb661cb38d72f38a5f7
MD5 fed30c256e9fc826d7a2f11c9563aa6e
BLAKE2b-256 7d16bba1c29eab9b11ed9d391920a65b253a2436ae9bd34f7a248b4f8291632d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page