if (config->flags & FLAG_SCROLL_LOCK)
leds |= INPUT_LED_SCROLL;
config->leds = leds;
+ config->leds_changed = flip;
}
}
config->allow_repeats = allow_repeats;
}
+int input_leds_changed(struct input_config *config)
+{
+ if (config->leds_changed)
+ return config->leds;
+
+ return -1;
+}
+
int input_add_tables(struct input_config *config, bool german)
{
struct kbd_entry *entry;
/* Which modifiers are active (1 bit for each MOD_... value) */
uchar modifiers;
uchar flags; /* active state keys (FLAGS_...) */
- uchar leds; /* active LEDS (INPUT_LED_...) */
+ uchar leds; /* active LEDs (INPUT_LED_...) */
+ uchar leds_changed; /* LEDs that just changed */
uchar num_tables; /* number of modifier tables */
int prev_keycodes[INPUT_BUFFER_LEN]; /* keys held last time */
int num_prev_keycodes; /* number of prev keys */
*/
void input_allow_repeats(struct input_config *config, bool allow_repeats);
+/**
+ * Check if keyboard LEDs need to be updated
+ *
+ * This can be called after input_tstc() to see if keyboard LEDs need
+ * updating.
+ *
+ * @param config Input state
+ * @return -1 if no LEDs need updating, other value if they do
+ */
+int input_leds_changed(struct input_config *config);
+
/**
* Set up the key map tables
*