/* SPDX-License-Identifier: GPL-3.0-or-later */ /* Copyright (C) 2021 KikooDX */ #include "input.h" #include void input_update(struct Input *input) { int i; clearevents(); i = KEYS_COUNT; while (i-- > 0) { if (keydown(input->keycodes[i])) input->keystates[i] = input->keystates[i] ? KS_DOWN : KS_PRESS; else input->keystates[i] = KS_UP; } }