Library to help with mouse input configuration
Project description
Introduction
Ephyra is a library to help with mouse input configuration; includes both Python and native C (CPython, tested with Windows 10 and Visual Studio 2019 tools) implementations. It supports full rotation and same screen ratio/distance approaches.
Usage
This code shows how to get sensitivity coefficients and values for a new application or a different view within same application as well as characteristic of a particular setup. See tests for more examples.
from fractions import Fraction
from math import radians
from ephyra import DataHelper, FT_HORIZONTAL, FS_HORIZONTAL_PLUS, FS_VERTICAL_MINUS, RT_AZIMUTHAL, \
FullRotationCalculator, ScreenRatioCalculator, DetailsCalculator
from ephyra.formula import horizontal_4_to_3_fov_coefficient, horizontal_fov_to_80_coefficient
dh1 = DataHelper(screen_aspect_ratio=Fraction(16, 10), fov=radians(90), fov_aspect_ratio=Fraction(4, 3),
fov_type=FT_HORIZONTAL, fov_scaling=FS_HORIZONTAL_PLUS, rt=RT_AZIMUTHAL,
ltr_coefficient_transformation_formula=horizontal_4_to_3_fov_coefficient,
radians_per_count=radians(0.022), counts_per_unit=800, screen_diagonal=24)
dh2 = DataHelper(screen_aspect_ratio=Fraction(16, 10), fov=radians(100), fov_aspect_ratio=Fraction(16, 10),
fov_type=FT_HORIZONTAL, fov_scaling=FS_VERTICAL_MINUS, rt=RT_AZIMUTHAL,
ltr_coefficient_transformation_formula=horizontal_fov_to_80_coefficient,
radians_per_count=radians(2.2278481012658227), counts_per_unit=800, screen_diagonal=24)
frc = FullRotationCalculator(dh1.primary_state, dh1.parameters, dh2.parameters)
fr_c, fr_sens = frc.sensitivity_for(s1_sens=2, s2=dh2.primary_state)
print(f'Full rotation & different applications, coefficient: {fr_c:.4f}, sensitivity: {fr_sens:.4f}')
src = ScreenRatioCalculator(ratio1=.10, s1=dh2.primary_state, p1=dh2.parameters)
dh2_s2 = dh2.get_state_for_fov(radians(40))
src_c, src_sens = src.sensitivity_for(s1_sens=.0158, s2=dh2_s2)
print(f'Screen ratio & same application, coefficient: {src_c:.4f}, sensitivity: {src_sens:.4f}')
dc = DetailsCalculator(dh1.primary_state, dh1.parameters)
print(f'Details, full rotation distance: {dc.full_rotation_units(sens=2):.4f}')
License
Ephyra is released under version 2.0 of the Apache License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ephyra-0.1.tar.gz.
File metadata
- Download URL: ephyra-0.1.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afb4770432feb3974238a83e0853d7a58c05d370e92a646c2972590cedfde753
|
|
| MD5 |
e175e810c66d58586fb6945cf1b5caf0
|
|
| BLAKE2b-256 |
4c8a73827a2b174f428fdabf0514b6b6bfe2a677ac01be69e2610e336ae0e2f3
|
File details
Details for the file ephyra-0.1-cp38-cp38-win_amd64.whl.
File metadata
- Download URL: ephyra-0.1-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 31.1 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e83dba3da166472f075ba0aeb784b29de18d0f0cc91d75ca79b5ef50d345c49f
|
|
| MD5 |
fa10a47d6614d3364f681c929f8076ae
|
|
| BLAKE2b-256 |
093221d31ad73352e622ad23f931728600bb652870e61944edad85d85b460ff9
|