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

Remove/resurrect key repeat functionality. #115

Open
1 of 3 tasks
gombosg opened this issue Dec 4, 2020 · 23 comments
Open
1 of 3 tasks

Remove/resurrect key repeat functionality. #115

gombosg opened this issue Dec 4, 2020 · 23 comments
Labels
Fund good first issue Good for newcomers low-priotity refactor Issues connected with cleaning-up repository

Comments

@gombosg
Copy link
Collaborator

gombosg commented Dec 4, 2020

  • 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:

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

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@gombosg gombosg added the refactor Issues connected with cleaning-up repository label Dec 4, 2020
@AriaMoradi
Copy link
Contributor

AriaMoradi commented Dec 4, 2020

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
Copy link
Collaborator Author

gombosg commented Dec 4, 2020

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
Copy link
Contributor

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
Copy link
Collaborator Author

gombosg commented Dec 4, 2020

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
Copy link
Contributor

here is where it was added: f72fee9

@gombosg
Copy link
Collaborator Author

gombosg commented Dec 4, 2020

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

@AriaMoradi
Copy link
Contributor

image
It was hidden from the get go...

@AriaMoradi
Copy link
Contributor

┌─ /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

This comment has been minimized.

@AriaMoradi
Copy link
Contributor

AriaMoradi commented Dec 4, 2020

#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
Copy link
Contributor

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

@AriaMoradi
Copy link
Contributor

AriaMoradi commented Dec 4, 2020

And it was removed at ce46443

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:16b4af6
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
Copy link
Contributor

Ryochan7 commented Dec 6, 2020

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
Copy link
Member

pktiuk commented Dec 13, 2020

I think we should remove this code.

@arcadepro
Copy link

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
Copy link

fuhreak commented Jan 21, 2023

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
Copy link
Member

pktiuk commented Feb 13, 2023

@fuhreak
Could you tell which games have this issue?

@fuhreak
Copy link

fuhreak commented Feb 13, 2023

@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
Copy link

djpsyc commented May 31, 2023

@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
Copy link
Member

pktiuk commented Jun 5, 2023

@djpsyc

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

@Ryochan7
Copy link
Contributor

Ryochan7 commented Jun 7, 2023

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
Copy link

djpsyc commented Jun 7, 2023

@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
Copy link

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

  • Repeating keys for changing brush size... also for Undos/Redos is more convenient just by holding a button.
  • Some application only accept a Ctrt+/Ctrl- hotkeys for zooming their layout and rapidly pressing buttons for this is tiresome...
  • Changing tab on Chrome or Notepad++ is a lot easy with the holding of an analog stick...

I wish antimicroX keeps this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fund good first issue Good for newcomers low-priotity refactor Issues connected with cleaning-up repository
Projects
None yet
Development

No branches or pull requests

8 participants