Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Add Point / Touch - keyboard mapping #13

Closed
jasonwkl opened this issue Sep 26, 2019 · 13 comments
Closed

Add Point / Touch - keyboard mapping #13

jasonwkl opened this issue Sep 26, 2019 · 13 comments

Comments

@jasonwkl
Copy link

Is it possible to add Bluetooth controller mapping to screen so it can be used on RPi fashioned much like a switch dock for playing android games.

@srevinsaju
Copy link
Owner

Did you mean, opening the Bluetooth panel with a keyboard shortcut, or switching Bluetooth on/off

@jasonwkl
Copy link
Author

Maybe this is not for the capability of this software but I was thinking more of letting a Bluetooth game controller map to a region on the screen, so that people can use a game controller to control buttons that is on the screen.

@srevinsaju
Copy link
Owner

srevinsaju commented Sep 26, 2019 via email

@jasonwkl
Copy link
Author

That exactly what I am thinking of. Sounds awesome. Can't wait to try it out.

@srevinsaju srevinsaju changed the title Add Bluetooth Controller mapping Add Point / Touch - keyboard mapping Oct 10, 2019
@srevinsaju
Copy link
Owner

@jasonwkl , its finally a feature. Get guiscrcpy v2.0 with Keyboard Mapping and let me know how it is https://github.com/srevinsaju/guiscrcpy/releases/tag/2.0

@srevinsaju
Copy link
Owner

Genymobile/scrcpy#712

@karousn
Copy link

karousn commented Mar 13, 2020

Firstly thank you for this project,
Can you give us an example how we can define a key mapping to do some event on scrcpy screen ?
in video or gif animation it will be perfect.

@srevinsaju
Copy link
Owner

@karousn I may not be able to give full video of it afaik, maybe these steps might be helpful

  • Connect your device
  • Type
guiscrcpy-mapper

in your terminal

  • If everything goes successful, you should see your phone screenshot
    image
  • Follow the on screen instructions
  • Close the window, now open guiscrcpy
  • Click this button to enable the mapped buttons
    image

@karousn
Copy link

karousn commented Mar 13, 2020

thank for the fast response.
I am not familiar with python script so i need some help in that.
To execute : guiscrcpy or guiscrcpy-mapper i have a problem with PyQt5.sip No module named 'PyQt5.sip'
for guiscrcpy i can executed with python3 -m guiscrcpy but i can't do the same with guiscrcpy-mapper
in stackoverflow i see this : https://stackoverflow.com/a/59712128

@srevinsaju
Copy link
Owner

@karousn we have a discord channel https://discord.gg/TyhR3B for guiscrcpy related issues. I can help you out in details, there
Maybe your default Python is 2.7
What does

python -V

give?

@karousn
Copy link

karousn commented Mar 13, 2020

python3 -V : Python 3.8.2
python -V : Command 'python' not found
Btw, using python3 scripts/guiscrcpy-mapper i am able to see the key mapper and it generate a json file called guiscrcpy.mapper.json on .config/guiscrcpy so for me i can start prepare a file to my need but i need an example.
using the guiscrcpy mapper i have this message error:
Lets Check Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/guiscrcpy-3.3-py3.8.egg/guiscrcpy/lib/mapper.py", line 185, in keyreg fixy = rely * int(dimValues[1]) ValueError: invalid literal for int() with base 10: '2960\nOverride size' PyQt5.QtCore.QPoint(365, 355) LAST
That why i need and example file to generate manually if we are in need.
Thank 👍

@srevinsaju
Copy link
Owner

Thanks, Seems like your device is using a Override resolution. This doesn't work, I will need to add that feature too. Thanks for finding this out.

@srevinsaju
Copy link
Owner

srevinsaju commented Mar 13, 2020

@karousn For your reference
This is a sample config file for the mapper json

{"key": [], "pos": [], 
"S": [296.4705882352941, 357.16129032258067], 
"K": [652.2352941176471, 417.0322580645161]}

The S key corresponds to the position x=296 and y=357
The K key corresponds to 652, 417
etc

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants