C

Qt Quick Ultralite Automotive Cluster Demo

// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial

#include "hmi_input.h"

void (*hmiInputInitRoutine)() = NULL;

void HMIInput::init()
{
    if (hmiInputInitRoutine) {
        hmiInputInitRoutine();
    }
}

void HMIInput::onEvent(const HMIInputEvent &event)
{
    if (event.type == HMIInputEvent::KeyPress) {
        pressed(event.key);
    } else {
        released(event.key);
    }
}