pywin32 icon indicating copy to clipboard operation
pywin32 copied to clipboard

Add touch in addition to click

Open bgcart opened this issue 5 years ago • 7 comments

This is a feature request (also open to helping contribute) to add touch input to the pywin32 API. It appears there is an equivalent input method to mouse_event, InjectTouchInput which would allow pywin32 to emulate touch. This would enable actions like auto-open of the on-screen keyboard on touch.

bgcart avatar Jan 10 '20 23:01 bgcart

With the microsoft surface on Windows 10, this becomes a pretty natural extension. Would love to see this incorporated, and could be something I'd work on too.

tscizzlebg avatar Jan 13 '20 05:01 tscizzlebg

Please feel free to contribute!

mhammond avatar Jan 13 '20 05:01 mhammond

Is there a guide for contributors? Like how to run tests, and such.

The README talks about building from source, but unclear to me if that's relevant or necessary or what, in order to develop.

My plan was to

  1. clone the repo
  2. get unit tests running/passing as a starting place before making any code changes
  3. then try and follow the trail of how mouse_event works and copy that strategy for touch.

I cloned, then ran python setup.py install, and it told me I needed the Windows SDK, which I was about to go and get but then decided I'd post this question first so that it's up while I investigate on my own in parellel.

tscizzlebg avatar Jan 13 '20 23:01 tscizzlebg

The README is the only guide. Sadly you need the compiler and sdk to be able to build things, which is going to be necessary here.

mhammond avatar Jan 13 '20 23:01 mhammond

Makes sense. However I do have Visual Studio and checked off the C++ workload, which I thought would supply the compiler and SDK.

Is there a step I'm overlooking? (before I'm able to run python setup.py install, and then I presume python pywin32_testall.py) Like to point to the compiler and SDK somehow?

tscizzlebg avatar Jan 14 '20 00:01 tscizzlebg

I suspect that find_platform_sdk_dir() simply doesn't know about the location of the SDKs installed by the later compilers. If you have a look at that function you will find it's possible to set a couple of env vars which might help, or if you don't mind shaving a yak or 2, you could try updating it to find it automatically.

mhammond avatar Jan 14 '20 00:01 mhammond

@tscizzlebg FWIW, https://github.com/mhammond/pywin32/pull/1936 removed the need for find_platform_sdk_dir, so you may try your luck at it again.

Also as a note to readers, python setup.py and the use of setup.py as a command line tool are deprecated. pywin32 itself needs to move away from it.

Avasam avatar Mar 12 '24 06:03 Avasam