Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button mapping #17

Open
BenoitCaron opened this issue Aug 5, 2020 · 8 comments
Open

Button mapping #17

BenoitCaron opened this issue Aug 5, 2020 · 8 comments

Comments

@BenoitCaron
Copy link

Hi,

I'm sure different people like different mappings. I don't really like the default mapping - do you think per user remapping could be done? Perhaps using the touch screen to assign controls?

Regards

@mkst
Copy link

mkst commented Aug 5, 2020

Easiest thing is to edit the code and recompile.

It should be fairly self explanatory,

if you wanted to map e.g. left trigger as 'X' then

    if (kDown & KEY_X)
        pad->button |= L_TRIG;

|= is effectively append. All the button definitions can be found here

@BenoitCaron
Copy link
Author

Thanks for the reply. I'll give it a try, though I've never compiled the project before and don't know if I'll be able to (Mac).

@mkst
Copy link

mkst commented Aug 5, 2020

Thanks for the reply. I'll give it a try, though I've never compiled the project before and don't know if I'll be able to (Mac).

Just jump on the https://discord.gg/7bcNTPK if you have any problems 👍

@BenoitCaron
Copy link
Author

BenoitCaron commented Aug 5, 2020

Okay I did it! Still wish this was available for people without technical knowledge :)

@mkst
Copy link

mkst commented Aug 6, 2020

Okay I did it! Still wish this was available for people without technical knowledge :)

Great work :) what layout did you change to?

@BenoitCaron
Copy link
Author

BenoitCaron commented Aug 6, 2020

Z button on the left shoulder button, as muscle memory makes me use my left index finger, camera view point on the right shoulder button, punch on Y, jump on B to mimic the N64 layout. Also punch on A and jump on X to have the reverse settings available in case my girlfriend prefers it this way, as they are unused otherwise.

static void controller_3ds_read(OSContPad *pad) {
    hidScanInput();
    u32 kDown = keysHeld();
    if (kDown & KEY_START)
        pad->button |= START_BUTTON;
    if (kDown & KEY_L)
        pad->button |= Z_TRIG;
    if (kDown & KEY_R)
        pad->button |= R_TRIG;
    if (kDown & (KEY_B | KEY_X))
        pad->button |= A_BUTTON;
    if (kDown & (KEY_Y | KEY_A))
        pad->button |= B_BUTTON;
    if (kDown & (KEY_DLEFT | KEY_CSTICK_LEFT))
        pad->button |= L_CBUTTONS;
    if (kDown & (KEY_DRIGHT | KEY_CSTICK_RIGHT))
        pad->button |= R_CBUTTONS;
    if (kDown & (KEY_DUP | KEY_CSTICK_UP))
        pad->button |= U_CBUTTONS;
    if (kDown & (KEY_DDOWN | KEY_CSTICK_DOWN))
        pad->button |= D_CBUTTONS;

    circlePosition pos;
    hidCircleRead(&pos);
    pad->stick_x = pos.dx / 2;
    pad->stick_y = pos.dy / 2;
}

@mkst
Copy link

mkst commented Aug 17, 2020

Not sure if you want to close this or leave it open until controls are configurable?

It's not much work to incorporate the configfile.h/c stuff which means you can then use a txt file to change controls to whatever you want (well, buttons, the analogue stick is still going to be the analogue stick!).

@Gericom LMK if you want me to raise a PR for the changes.

@BenoitCaron
Copy link
Author

Well I suppose I don't have an issue with the controls anymore, but this is still not user friendly as is, for people who have absolutely no knowledge in programing?

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

No branches or pull requests

2 participants