AntiMicroX / antimicrox

Graphical program used to map keyboard buttons and mouse controls to a gamepad. Useful for playing games with no gamepad support.
GNU General Public License v3.0
2.38k stars 142 forks source link

Remove/resurrect key repeat functionality. #115

Open gombosg opened 3 years ago

gombosg commented 3 years ago

Todo:

Upvote & Fund

Fund with Polar

AriaMoradi commented 3 years ago

I think it's a necessary/added luxury feature for some games, but more useful on a key basis(i.e. in NES games the Y key(xbox controller) bashes the jump key).

gombosg commented 3 years ago

Looks like this is the same in antimicro - present but hidden from users. We have turbo setting for each key, so why is this different?

AriaMoradi commented 3 years ago

Looks like this is the same in antimicro - present but hidden from users. We have turbo setting for each key, so why is this different?

git blame is your friend...

gombosg commented 3 years ago

It is, it's just I don't have time to sort it out now. Feel free to take it if you're interested.

AriaMoradi commented 3 years ago

here is where it was added: https://github.com/AntiMicroX/antimicrox/commit/f72fee927751d44ca9a729692ffc5d9c7a92bfc8

gombosg commented 3 years ago

Yes, and it is hidden, and it was never exposed to users. The question is why. Not working? Never tested?

AriaMoradi commented 3 years ago

image It was hidden from the get go...

AriaMoradi commented 3 years ago
┌─ /tmp/antimicro-2.3.1/antimicrox-2.3.1/src
└─ ❯ grep -i keyRepeatGroupBox -r .
grep: ./antimicro: binary file matches
grep: ./mainsettingsdialog.o: binary file matches
./ui_mainsettingsdialog.h:    QGroupBox *keyRepeatGroupBox;
./ui_mainsettingsdialog.h:        keyRepeatGroupBox = new QGroupBox(General);
./ui_mainsettingsdialog.h:        keyRepeatGroupBox->setObjectName(QString::fromUtf8("keyRepeatGroupBox"));
./ui_mainsettingsdialog.h:        verticalLayout_6 = new QVBoxLayout(keyRepeatGroupBox);
./ui_mainsettingsdialog.h:        keyRepeatEnableCheckBox = new QCheckBox(keyRepeatGroupBox);
./ui_mainsettingsdialog.h:        label_4 = new QLabel(keyRepeatGroupBox);
./ui_mainsettingsdialog.h:        keyDelayHorizontalSlider = new QSlider(keyRepeatGroupBox);
./ui_mainsettingsdialog.h:        keyDelaySpinBox = new QSpinBox(keyRepeatGroupBox);
./ui_mainsettingsdialog.h:        label_5 = new QLabel(keyRepeatGroupBox);
./ui_mainsettingsdialog.h:        keyRateHorizontalSlider = new QSlider(keyRepeatGroupBox);
./ui_mainsettingsdialog.h:        keyRateSpinBox = new QSpinBox(keyRepeatGroupBox);
./ui_mainsettingsdialog.h:        verticalLayout_3->addWidget(keyRepeatGroupBox);
./ui_mainsettingsdialog.h:        keyRepeatGroupBox->setTitle(QCoreApplication::translate("MainSettingsDialog", "Key Repeat", nullptr));
./mainsettingsdialog.ui:          <widget class="QGroupBox" name="keyRepeatGroupBox">
./mainsettingsdialog.cpp:    ui->keyRepeatGroupBox->setVisible(false);

Any ideas?

AriaMoradi commented 3 years ago

and there is turboCheckBox: image

Maybe the feature was to set a "global turbo rate" value? Shouldn't it have a recommended hard-coded value and let the user override it on a key basis? Maybe @Ryochan7 could help clear this up.

AriaMoradi commented 3 years ago
#ifdef Q_OS_WIN
    QSettings autoRunReg(RUNATSTARTUPKEY, QSettings::NativeFormat);
    QString autoRunEntry = autoRunReg.value("antimicro", "").toString();
    if (!autoRunEntry.isEmpty())
    {
        ui->launchAtWinStartupCheckBox->setChecked(true);
    }

    bool keyRepeatEnabled = settings->value("KeyRepeat/KeyRepeatEnabled", false).toBool();
    if (keyRepeatEnabled)
    {
        ui->keyRepeatActiveCheckBox->setChecked(true);
        ui->keyDelayHorizontalSlider->setEnabled(true);
        ui->keyDelaySpinBox->setEnabled(true);
        ui->keyRateHorizontalSlider->setEnabled(true);
        ui->keyRateSpinBox->setEnabled(true);
    }

    int keyRepeatDelay = settings->value("KeyRepeat/KeyRepeatDelay", InputDevice::DEFAULTKEYREPEATDELAY).toInt();
    int keyRepeatRate = settings->value("KeyRepeat/KeyRepeatRate", InputDevice::DEFAULTKEYREPEATRATE).toInt();

    ui->keyDelayHorizontalSlider->setValue(keyRepeatDelay);
    ui->keyDelaySpinBox->setValue(keyRepeatDelay);

    ui->keyRateHorizontalSlider->setValue(1000/keyRepeatRate);
    ui->keyRateSpinBox->setValue(1000/keyRepeatRate);

#else
    ui->launchAtWinStartupCheckBox->setVisible(false);
    ui->keyRepeatGroupBox->setVisible(false);

#endif

and looks line it's a windows-only feature because of Q_OS_WIN, ref: https://doc.qt.io/qt-5/qtglobal.html#Q_OS_WIN

AriaMoradi commented 3 years ago

and looks line it's a windows-only feature because of Q_OS_WIN, ref: https://doc.qt.io/qt-5/qtglobal.html#Q_OS_WIN

image

confirmed. then maybe we want to add the feature to linux. :grimacing:

AriaMoradi commented 3 years ago

And it was removed at https://github.com/AntiMicroX/antimicrox/commit/ce464439650f0c7b87c2f02318bfde9928f91315

Ok this is bad! to restore windows we probably have to bring back this deleted code(and probably much more...)

And also there's this:https://github.com/AntiMicroX/antimicrox/commit/16b4af62574ddc10faa1054e9f08a39e05b87640 which is a part of 2.25(just a few versions after 2.23 which is made by the original team.)

Then I think to restore windows It maybe best to start from somewhere between 2.25 and 2.23 and port back new features from what we have now to windows...

Ryochan7 commented 3 years ago

Haven't played with this program since around early 2018 I believe; used it along with MoltenGamepad for my old Wiimote config. The turbo key and key repeat features provide different functionality. The key repeat feature is not really used for games but for Desktop usage like when using a text editor. SendInput (and I believe XTest) do not provide a means to mock key repeating like what normally occurs when using a physical keyboard. The key repeat feature is meant to add fake key repeating by continuing to send key events (cannot remember which event type) at the specified interval. The Uinput event system supports key repeating directly so that feature is not needed when using that event system.

For the most part, that old feature should not be needed for Linux users as most people should probably be using the UInput event system if configured. BSD users (if anyone still uses this on BSD) and Windows users might want the feature to be present but it should not be necessary for playing games.

pktiuk commented 3 years ago

I think we should remove this code.

arcadepro commented 2 years ago

It's useful if you use the joypad in a desktop scenario. You assign the dpad to the arrow keys and scroll line by line in documents/web browsers.

fuhreak commented 1 year ago

Several older games I play require this and will not work without it. They will accept the input only the first time the key is pressed and will not repeat actions properly. Using turbo does not produce the same result either as it will only do the first press action but not the repeated action. Windows 10 User.

pktiuk commented 1 year ago

@fuhreak
Could you tell which games have this issue?

fuhreak commented 1 year ago

@fuhreak Could you tell which games have this issue?

MapleStory is the only one I can remember but I've seen it in at least two other games.

The easiest way to reproduce the problem is to create a character and hold the jump/attack buttons down. Both are supposed to repeat the action while held, however when using antimicrox it will only jump or attack once then stop. It should also be noted that antimicro also had this problem but only on Shift Alt and CTRL.

djpsyc commented 1 year ago

@fuhreak Could you tell which games have this issue?

Thought i would also give my two cents to this matter:

Like @arcadepro mentioned this is a pretty usefull feature in context of Windows desktop and other software such as Blender or Krita. I have been using Antimicro 2.23 for years to map keys onto my joypad and use it for shortcuts instead of my keyboard however since it is not being updated anymore i tried to move to AntmicroX today but quickly realized this feature isn't working so i had to fall back onto 2.24 and am now stuck there. So take this as me imploring to not just drop this super useful/convenient feature i guess... I understand this is open source and you devs work on this in your free time but I just wanted ppl to know that antimicro is not just used for games and in scenarios such as drawing digitally the key repeat is very useful.

pktiuk commented 1 year ago

@djpsyc

Could you describe how this feature was used in Blender/Krita?

Ryochan7 commented 1 year ago

It would be interesting to hear about some examples of Windows games affected by a lack of key repeat functionality. For me, key repeat was mainly necessary on the desktop.

I have had key repeat functionality available for a long time in recent experiments. DS4Windows uses a 500 ms delay followed by a 25 ms interval between keydown events; the relevant Commit routine is run every gamepad poll. The FakerInput virtual KB+M driver allows Windows to handle key repeat functionality directly. DS4Windows supports the use of that driver and my recent experimental mappers use FakerInput for KB+M emulation exclusively.

djpsyc commented 1 year ago

@djpsyc

Could you describe how this feature was used in Blender/Krita?

Certainly, @pktiuk, I have not worked much in Blender yet and it was mostly mentioned as possible use case scenario as i am still mostly a 2D artist. I have however started using an 8bitdo switch lite controller for it to use as shortcut remote simply because the distinct shape of controller buttons and layout make it easier for me to learn shortcuts compared to a keyboard. In Krita however I use the repeating key press function a lot! Whenever i need to zoom/rotate in increments or even more commonly when i need to change my brush size in increments but semi fast i make use of said function. Having to tap rapidly by hand can get annoying pretty fast. Sure there's other shortcuts i could use but for me that's the easiest and most comfortable way that has stuck with me over the past 3 years that i have been using antimicro for when creating my art.

rootaman commented 1 month ago

I am still using antimicro 2.23 and can not move to antimicrox because of this "key repeat" feature...

My purpose is using a PSMove Navigation controller for sending hotkeys in 2D graphic design/painting or multiple-tabs applications like Chrome or Notepad++.

I wish antimicroX keeps this feature.