antimicrox icon indicating copy to clipboard operation
antimicrox copied to clipboard

Remove/resurrect key repeat functionality.

Open gombosg opened this issue 3 years ago • 22 comments

  • joykeyrepeathelper.h and joykeyrepeathelper.cpp are not compiled.
  • There are hidden key repeat settings in mainsettingsdialog.ui.
  • Just search for "keyrepeat" in the repo.

Todo:

  • [x] Learn what this does and why it was disabled.
  • [ ] ~If useful, try re-enabling~.
  • [ ] If not, remove dead code.

gombosg avatar Dec 04 '20 10:12 gombosg

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).

AriaMoradi avatar Dec 04 '20 10:12 AriaMoradi

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?

gombosg avatar Dec 04 '20 10:12 gombosg

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...

AriaMoradi avatar Dec 04 '20 11:12 AriaMoradi

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

gombosg avatar Dec 04 '20 11:12 gombosg

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

AriaMoradi avatar Dec 04 '20 12:12 AriaMoradi

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

gombosg avatar Dec 04 '20 12:12 gombosg

image It was hidden from the get go...

AriaMoradi avatar Dec 04 '20 13:12 AriaMoradi

┌─ /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 avatar Dec 04 '20 13:12 AriaMoradi

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 avatar Dec 04 '20 13:12 AriaMoradi

#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 avatar Dec 04 '20 13:12 AriaMoradi

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 avatar Dec 04 '20 13:12 AriaMoradi

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...

AriaMoradi avatar Dec 04 '20 13:12 AriaMoradi

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.

Ryochan7 avatar Dec 06 '20 18:12 Ryochan7

I think we should remove this code.

pktiuk avatar Dec 13 '20 21:12 pktiuk

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.

arcadepro avatar Mar 20 '22 07:03 arcadepro

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.

fuhreak avatar Jan 21 '23 06:01 fuhreak

@fuhreak
Could you tell which games have this issue?

pktiuk avatar Feb 13 '23 11:02 pktiuk

@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.

fuhreak avatar Feb 13 '23 20:02 fuhreak

@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.

djpsyc avatar May 31 '23 21:05 djpsyc

@djpsyc

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

pktiuk avatar Jun 05 '23 14:06 pktiuk

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.

Ryochan7 avatar Jun 07 '23 14:06 Ryochan7

@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.

djpsyc avatar Jun 07 '23 17:06 djpsyc