Comments (12)
https://discord.com/channels/560281725175988233/1118341089355636776/1153034882075861032
from handygccs.
You would need to trigger changing to gamepad mode on the controller. There are some scripts floating around on the discord that do this but they stopped working on kernel 6.5 so we suspect a libusb change broke it. That's the only way to make the back buttons act individually. You lose all the other combos in that mode where the back button acts like a modifier key.
How are you planning on simulating four keys with just two keys?
If you want to add those keys as emitable events you'll need to map them in constants.py, I.E. EVENT_BTN_A. K at the BTN_MODE map as an example of a single key.
from handygccs.
I expressed myself inaccurately, meaning that each of the back buttons would correspond to one of the ABXY :)
from handygccs.
There are only two back buttons?
from handygccs.
Yes, both come to process_event function as active_keys = [185]
from handygccs.
I know, I daily drive one of them. I was just confused how you want to map four buttons to two buttons but I think I understand.
from handygccs.
Now I'm playing Armored Core VI, so i want to map back buttons as A and X buttons.
from handygccs.
I was able to made back buttons as A button with following code:
button_a = [
[e.EV_KEY, e.BTN_A]
]
if active_keys == [185] \
and button_on in [1, 2]:
await handycon.emit_now(seed_event, button_a, 1)
elif active_keys == [] \
and seed_event.code == 185 \
and button_on == 0:
await handycon.emit_now(seed_event, button_a, 0)
from handygccs.
I was able to made back buttons as A button with following code:
button_a = [ [e.EV_KEY, e.BTN_A] ] if active_keys == [185] \ and button_on in [1, 2]: await handycon.emit_now(seed_event, button_a, 1) elif active_keys == [] \ and seed_event.code == 185 \ and button_on == 0: await handycon.emit_now(seed_event, button_a, 0)
I don't recommend you do this. The problem is the back button's lose their state if another button is pressed when they are in the "default" mode, meaning if you were to press another button before releasing the back button, you wont get a key up event for the back button. This will leave you in a position where you need to press the button again to end the press.
Additionally, this will emit an A down event and interfere with the logic of the macro keys mapped to the ABXY/Dpad and back buttons.
In the gamepad mode they retain their state and this isn't an issue, and they also have unique event ID's.
from handygccs.
Can you share link for info about gamepad mode? I cant fined it on discord :(
from handygccs.
I was able to made back buttons as A button with following code:
button_a = [ [e.EV_KEY, e.BTN_A] ] if active_keys == [185] \ and button_on in [1, 2]: await handycon.emit_now(seed_event, button_a, 1) elif active_keys == [] \ and seed_event.code == 185 \ and button_on == 0: await handycon.emit_now(seed_event, button_a, 0)I don't recommend you do this. The problem is the back button's lose their state if another button is pressed when they are in the "default" mode, meaning if you were to press another button before releasing the back button, you wont get a key up event for the back button. This will leave you in a position where you need to press the button again to end the press.
Additionally, this will emit an A down event and interfere with the logic of the macro keys mapped to the ABXY/Dpad and back buttons.
In the gamepad mode they retain their state and this isn't an issue, and they also have unique event ID's.
I see it now, when one or both of back buttons being hold - Y button starts to act as A button. After this hold state of A button is broken.
from handygccs.
Thanks, totally what i was looking for :) Swapped "Toggle performance" to A and X with M1/M2 buttons
def init_handheld(...):
...
with usb1.USBContext() as usb_context:
dev = open_dev(0x0b05, 0x1abe, usb_context)
if dev.kernelDriverActive(2) == 1:
dev.detachKernelDriver(2)
dev.claimInterface(2)
dev.resetDevice()
replay(dev)
dev.releaseInterface(2)
dev.attachKernelDriver(2)
from handygccs.
Related Issues (20)
- building from source needs pacman HOT 1
- Right Menu button change button mappings HOT 5
- Pressing the volume keys or other function keys wakes up the device while it's in sleep mode, but the controller doesn't cause a wake-up. This can easily lead to accidental activation. I would like only the power key to be able to wake up the device. HOT 1
- Suspend issue on Ayaneo air pro HOT 1
- Permission Denied Error
- handycon doesn't survive suspend/resume HOT 5
- [bug] Back buttons on GPD Win 4 not functional in gamepadui HOT 14
- Handycon can't detect keyboard 2 on Ally HOT 5
- ONEXPLAYER 2 PRO Support HOT 21
- ALLY Controller behaves weirdly when using nintendo layout HOT 1
- Systemd Service failure HOT 2
- Dpad stops working rog ally HOT 3
- Add GPD WIN Mini HOT 5
- Rog Ally Device ID not supported HOT 1
- GPD Win 4 not working? HOT 12
- GPD WIN4 HOT 3
- ASUSTek ROG Ally RC71L (2023) HOT 2
- Allow configuration of combinations and/or long-presses
- Add additional event type to configuration HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from handygccs.