Giter Site home page Giter Site logo

Comments (12)

pastaq avatar pastaq commented on September 19, 2024 1

https://discord.com/channels/560281725175988233/1118341089355636776/1153034882075861032

from handygccs.

pastaq avatar pastaq commented on September 19, 2024

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.

dasshit avatar dasshit commented on September 19, 2024

I expressed myself inaccurately, meaning that each of the back buttons would correspond to one of the ABXY :)

from handygccs.

pastaq avatar pastaq commented on September 19, 2024

There are only two back buttons?

from handygccs.

dasshit avatar dasshit commented on September 19, 2024

Yes, both come to process_event function as active_keys = [185]

Buttons

from handygccs.

pastaq avatar pastaq commented on September 19, 2024

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.

dasshit avatar dasshit commented on September 19, 2024

Now I'm playing Armored Core VI, so i want to map back buttons as A and X buttons.

from handygccs.

dasshit avatar dasshit commented on September 19, 2024

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.

pastaq avatar pastaq commented on September 19, 2024

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.

dasshit avatar dasshit commented on September 19, 2024

Can you share link for info about gamepad mode? I cant fined it on discord :(

from handygccs.

dasshit avatar dasshit commented on September 19, 2024

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.

dasshit avatar dasshit commented on September 19, 2024

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)

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.