Skip to main content

Library for interacting with SteelSeries GameSense 3.8.x

Project description

gamesense

A Python library for use with SteelSeries GameSense 3.8.X+

Installation

There are two different versions of this package. One supports normal synchronous function calls and the other support python's asynchronous functionality.

To install the sync version run:

pip install gamesense[sync]

To install the async version run:

pip install gamesense[async]

Or both:

pip install gamesense[sync,async]

Usage

Relatively simple to use.

For synchronous usage:

import gamesense

# Create a GameSense object instance to use
gs = gamesense.GameSense("SYNC_GAME", "Sync Game")

# Before you can register or send events, you must register your game
gs.register_game(icon_color_id=gamesense.GS_ICON_GOLD)

# Register an event (different than binding an event, see more info in the SteelSeries docs)
gs.register_event("DID_STUFF")

# Test out the event by sending the event
gs.send_event("DID_STUFF", {"value": 22})

For asynchronous usage:

import asyncio
import gamesense

# For example purposes, need an event loop 
# Inside normal async functions, you'd just use await on the functions provided on AioGameSense
loop = asyncio.get_event_loop()

# Create a GameSense object instance to use
gs = gamesense.AioGameSense("ASYNC_GAME", "Async Game")

# Before you can register or send events, you must register your game
loop.run_until_complete(gs.register_game())

# Register an event (different than binding an event, see more info in the SteelSeries docs)
loop.run_until_complete(gs.register_event('DID_STUFF'))

# Test out the event by sending the event
loop.run_until_complete(gs.send_event("DID_STUFF", {"value": 23}))

The two examples do relatively the same thing. For more information about the SteelSeries GameSense API, see: https://github.com/SteelSeries/gamesense-sdk/tree/master/doc/api for more information. Things like binding handlers and such should be possible, but can be a bit complex. Commits are welcome for making such functionality easier.

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

gamesense-0.0.5.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

gamesense-0.0.5-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file gamesense-0.0.5.tar.gz.

File metadata

  • Download URL: gamesense-0.0.5.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

File hashes

Hashes for gamesense-0.0.5.tar.gz
Algorithm Hash digest
SHA256 f61ce6309fcf52f72b9da0300755c897acae97ba7f1a1c52d65343ab3e255789
MD5 1a0712a7e40e43d1f6f2aff0cd2ec2df
BLAKE2b-256 565b8b427369c9f2e5a54c41d5f3b423bd56d1e2768fe0ba94aa7154fd136e39

See more details on using hashes here.

File details

Details for the file gamesense-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: gamesense-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

File hashes

Hashes for gamesense-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1c3a1b10b5a43adccb25a610b922903d0484d750fcfd80543b511b8115bf0a1d
MD5 183f560653710588b3f7ba40f56946f2
BLAKE2b-256 e7573055c861f161114eb5ff967988381c2277b6b4d3b804b5eb1eca9bb8fe5f

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