Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

A wrapper library for WinIO

Project Description

A wrapper library for winio .

Thanks for the great WinIO library which comes from Yariv Kaplan.

The WinIO library binary distribution will download from http://www.internals.com/ during setup.

Usage

  • Keyboard Emulation
import rabird.winio
import time
import win32api
import win32con
import atexit

# KeyBoarD Commands
# Command port
KBC_KEY_CMD = 0x64
# Data port
KBC_KEY_DATA = 0x60

__winio = None

def __get_winio():
    global __winio

    if __winio is None:
            __winio = rabird.winio.WinIO()
            def __clear_winio():
                    global __winio
                    __winio = None
            atexit.register(__clear_winio)

    return __winio

def wait_for_buffer_empty():
    '''
    Wait keyboard buffer empty
    '''

    winio = __get_winio()

    dwRegVal = 0x02
    while (dwRegVal & 0x02):
            dwRegVal = winio.get_port_byte(KBC_KEY_CMD)

def key_down(scancode):
    winio = __get_winio()

    wait_for_buffer_empty();
    winio.set_port_byte(KBC_KEY_CMD, 0xd2);
    wait_for_buffer_empty();
    winio.set_port_byte(KBC_KEY_DATA, scancode)

def key_up(scancode):
    winio = __get_winio()

    wait_for_buffer_empty();
    winio.set_port_byte( KBC_KEY_CMD, 0xd2);
    wait_for_buffer_empty();
    winio.set_port_byte( KBC_KEY_DATA, scancode | 0x80);

def key_press(scancode, press_time = 0.2):
    key_down( scancode )
    time.sleep( press_time )
    key_up( scancode )


# Press 'A' key
key_press(ord('a'))

Privilege Requirements

WinIo requires administrative privileges to run properly. This can be achieved by:

  • Using WinIo from a service running as LocalSystem (SE_LOAD_DRIVER_NAME privilege must be explicitly enabled).
  • Embedding a manifest file in the application that requests privilege elevation.
  • Requiring the user to choose the “Run as Administrator” option when launching the application.

The included C# samples demonstrate using an embedded manifest file to request privilege elevation.

Driver Signing Requirements on 64-bit Systems

64-bit versions of Windows only load device drivers that are signed by a code signing certificate issued by a public CA such as Verisign, Thawte, etc. WinIo64.sys must not be deployed on production machines unless a code signing certificate is obtained and used to sign this file. The bundled copy of WinIo64.sys is signed with a self-signed certificate and can only be used on development/test machines with Windows running in a special “test” mode. In order to use the bundled version of WinIo64.sys, you need to take the following steps:

  • Open an elevated command window by right-clicking the icon and clicking “Run as Administrator”.
  • Type the following command to enable test-signing:
bcdedit.exe /set TESTSIGNING ON
  • Reboot the machine

For more information on Windows driver signing requirements, please refer to http://www.microsoft.com/whdc/winlogo/drvsign/kmcs_walkthrough.mspx.

Licenses

This library used MIT license which already descripted in LICENSE.txt

WinIO library’s license descripted in LICENSE-WINIO.txt

Changes

0.1.9 (2015-12-02)

  • Can’t install from packaged zip file due to missing rabird_bootstrap.py

0.1.8 (2015-09-09)

  • Fixed not working with 64bits os

0.1.0 (2015-08-18)

  • Fixed not working with python3

0.0.9 (2015-08-18)

  • Initial release
Release History

Release History

This version
History Node

0.1.11

History Node

0.1.6

History Node

0.1.0

History Node

0.0.27

History Node

0.0.26

History Node

0.0.25

History Node

0.0.24

History Node

0.0.23

History Node

0.0.22

History Node

0.0.21

History Node

0.0.20

History Node

0.0.19

History Node

0.0.18

History Node

0.0.17

History Node

0.0.16

History Node

0.0.15

History Node

0.0.14

History Node

0.0.13

History Node

0.0.12

History Node

0.0.11

History Node

0.0.10

History Node

0.0.9

History Node

0.0.8

History Node

0.0.7

History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

History Node

0.0.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
rabird.winio-0.1.11.zip (17.1 kB) Copy SHA256 Checksum SHA256 Source Mar 10, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting