Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dcfcf5d0 authored by Michael Wright's avatar Michael Wright
Browse files

Add idc config option for handling key repeats

Bug: 13285870
Change-Id: I3c1cd5fb0a02dfb3432c1f04d0eef2d4970857ea
parent bb9c93bb
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -2041,6 +2041,10 @@ void KeyboardInputMapper::configureParameters() {
    if (mParameters.orientationAware) {
    if (mParameters.orientationAware) {
        mParameters.hasAssociatedDisplay = true;
        mParameters.hasAssociatedDisplay = true;
    }
    }

    mParameters.handlesKeyRepeat = false;
    getDevice()->getConfiguration().tryGetProperty(String8("keyboard.handlesKeyRepeat"),
            mParameters.handlesKeyRepeat);
}
}


void KeyboardInputMapper::dumpParameters(String8& dump) {
void KeyboardInputMapper::dumpParameters(String8& dump) {
@@ -2049,6 +2053,8 @@ void KeyboardInputMapper::dumpParameters(String8& dump) {
            toString(mParameters.hasAssociatedDisplay));
            toString(mParameters.hasAssociatedDisplay));
    dump.appendFormat(INDENT4 "OrientationAware: %s\n",
    dump.appendFormat(INDENT4 "OrientationAware: %s\n",
            toString(mParameters.orientationAware));
            toString(mParameters.orientationAware));
    dump.appendFormat(INDENT4 "HandlesKeyRepeat: %s\n",
            toString(mParameters.handlesKeyRepeat));
}
}


void KeyboardInputMapper::reset(nsecs_t when) {
void KeyboardInputMapper::reset(nsecs_t when) {
@@ -2166,6 +2172,10 @@ void KeyboardInputMapper::processKey(nsecs_t when, bool down, int32_t keyCode,
        policyFlags |= POLICY_FLAG_WAKE_DROPPED;
        policyFlags |= POLICY_FLAG_WAKE_DROPPED;
    }
    }


    if (mParameters.handlesKeyRepeat) {
        policyFlags |= POLICY_FLAG_DISABLE_KEY_REPEAT;
    }

    if (metaStateChanged) {
    if (metaStateChanged) {
        getContext()->updateGlobalMetaState();
        getContext()->updateGlobalMetaState();
    }
    }
+1 −0
Original line number Original line Diff line number Diff line
@@ -1086,6 +1086,7 @@ private:
    struct Parameters {
    struct Parameters {
        bool hasAssociatedDisplay;
        bool hasAssociatedDisplay;
        bool orientationAware;
        bool orientationAware;
        bool handlesKeyRepeat;
    } mParameters;
    } mParameters;


    void configureParameters();
    void configureParameters();