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.53k stars 146 forks source link

azerty not supported ? #1084

Closed Fr-Dae closed 2 weeks ago

Fr-Dae commented 2 weeks ago

Is there an existing issue for this?

Current Behavior

antimicrox 3.5.0 windows 10

at top, antimicro at bottom, my keyboard. Capture

Expected Behavior

No response

Steps To Reproduce

No response

Environment

Version 3.5.0
Compiled from packaging: GitHub Windows Release
Built Against SDL 2.30.6
Fonctionne avec SDL 2.30.6
Utilise Qt 6.7.3
Utilise SendInput comme gestionnaire d'événement
Host OS: windows Version: 10 Architecture: x86_64

Anything else?

No response


Upvote & Fund

Fund with Polar

pktiuk commented 2 weeks ago

Nope, only QWERTY keyboard layout is showed in the assignment menu. But I find it just a minor inconvenience

Fr-Dae commented 2 weeks ago

"minor" qwerty keyboard have less key usable than azerty :/ why close the issue if it's not resolve ? it's complicate to use DIK Code for auto assign layout ( azerty -fr azerty be, DE, and all other keyboard)

Fr-Dae commented 2 weeks ago

@pktiuk

Fr-Dae commented 2 weeks ago

hypotetique idea for use DIK code with QTKeyEvents

#include <QtCore/QCoreApplication>
#include <QtCore/QTimer>
#include <QtCore/QObject>
#include <QDebug>
#include <QKeyEvent>
#include <QWidget>

class KeyEventHandler : public QObject {
    Q_OBJECT

public:
    explicit KeyEventHandler(QObject* parent = nullptr)
        : QObject(parent) {}

signals:
    void keyPressed(int key);  // Signal émis lorsque une touche est pressée

public slots:
    void handleKeyEvent(QKeyEvent* event) {
        if (event->type() == QEvent::KeyPress) {
            emit keyPressed(event->key());  // Émettre le signal avec le code de la touche pressée
        }
    }
};

class MainWindow : public QWidget {
    Q_OBJECT

public:
    MainWindow(QWidget* parent = nullptr)
        : QWidget(parent), keyEventHandler(new KeyEventHandler(this)) {

        // Connecter le signal keyPressed à un slot dans MainWindow
        connect(keyEventHandler, &KeyEventHandler::keyPressed, this, &MainWindow::onKeyPressed);

        // Connecter l'événement clavier à la méthode handleKeyEvent
        installEventFilter(keyEventHandler);
    }

    ~MainWindow() {
        delete keyEventHandler;
    }

private slots:
    void onKeyPressed(int key) {
        // Traiter la touche pressée en fonction de son code
        qDebug() << "Touche pressée, code:" << key;

        // Exemple de traitement des touches
        switch (key) {
            case Qt::Key_A:
                qDebug() << "La touche A a été pressée";
                break;
            case Qt::Key_B:
                qDebug() << "La touche B a été pressée";
                break;
            default:
                qDebug() << "Autre touche pressée: " << key;
                break;
        }
    }

protected:
    bool event(QEvent* event) override {
        // Passer l'événement au filtre d'événements
        return QWidget::event(event);
    }

private:
    KeyEventHandler* keyEventHandler;
};

int main(int argc, char *argv[]) {
    QCoreApplication a(argc, argv);

    MainWindow window;
    window.show();

    return a.exec();
}

#include "main.moc"
pktiuk commented 1 week ago

"minor" qwerty keyboard have less key usable than azerty :/

Then you can tell which buttons are missing and they can be placed in the list on the right side of assignment window.