Giter VIP home page Giter VIP logo

Comments (8)

moses-palmer avatar moses-palmer commented on July 20, 2024

from pynput.

humanely avatar humanely commented on July 20, 2024

Here is a sample code, on_xyz are usual

from __future__ import absolute_import, division, print_function, unicode_literals
from pynput.mouse import Listener as mlisnr
from pynput.keyboard import Key,  Listener as klisnr
def main():
    # Collect events until released
    with klisnr( on_press=on_press, on_release=on_release) as kl,mlisnr(  on_click=on_click, on_scroll=on_scroll) as ml  :
        while True :
            try:
                #kl.join()
                ml.join()
                time.sleep(5)
                kl.stop
                ml.stop
                print("Stopped")
            except Exception as e:
                print("Some error in Mouse/Keyboard Listeners"+e)
                traceback.print_exc(file=sys.stdout)
                kl.stop
                ml.stop

if __name__ == "__main__":
    main()

from pynput.

humanely avatar humanely commented on July 20, 2024

Also in on_clicked:

`def on_click(x, y, button, pressed):


    driver = webdriver.Chrome("C:\work\chromedriver_win32\chromedriver.exe")
    try:

        print("URL = "+str(driver.current_url))
        #driver.get('http://codepad.org')
    except Exception as e:
        traceback.print_exc(file=sys.stdout)
`

from pynput.

moses-palmer avatar moses-palmer commented on July 20, 2024

from pynput.

humanely avatar humanely commented on July 20, 2024

Thanks. Look forward to future. Anyway I can contribute?
Is there a feature list for next version planned?

from pynput.

moses-palmer avatar moses-palmer commented on July 20, 2024

There is not really a list of features available---I guess a github wiki page would be perfect for that. The features that I have plans to implement include:

  • Support for simulating multi touch tablets. This would be a new type of input device along keyboard and mouse. I have not yet looked in to whether this is actually supported on all platforms.
  • Migration plan for Linux. Since X will soon be replaced in some distributions, backends to support Wayland and Mir are required. This may unfortunately not be possible, since at least Wayland does not support any of the functionality required by pynput by default.
  • Support for all lock keys. The first step would be make the caps lock implementation less hardcoded to make is easier to add lock keys. This first step would also help with implementing support for the numeric keypad and num lock.
  • Adding a CONTRIBUTING.md file.

from pynput.

humanely avatar humanely commented on July 20, 2024

Thanks. Is there a plan to add unicode conversion of keys? Something like this here: https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx

from pynput.

moses-palmer avatar moses-palmer commented on July 20, 2024

Unicode characters are supported as input to pynput.keyboard.Controller and are possible to retrieve in the callbacks registered with pynput.keyboard.Listener; I'm afraid that I don't really understand what you mean by unicode conversion of keys. The constants listed in the link you provided are defined here.

By the way, I have changed the listener code to not discard exceptions raised by callbacks; the are now reraised when the listener thread is joined. As this breaks the old API, the version will be bumped to 1.2 with the next release.

from pynput.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.