Add a helper function to get the capslock-state from the terminal.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
return terminal->name;
}
+bool
+ply_terminal_get_capslock_state (ply_terminal_t *terminal)
+{
+ char state;
+
+ if (ioctl (terminal->fd, KDGETLED, &state) < 0)
+ return false;
+
+ return (state & LED_CAP);
+}
+
int
ply_terminal_get_vt_number (ply_terminal_t *terminal)
{
bool should_ignore);
const char *ply_terminal_get_name (ply_terminal_t *terminal);
+bool ply_terminal_get_capslock_state (ply_terminal_t *terminal);
int ply_terminal_get_vt_number (ply_terminal_t *terminal);
bool ply_terminal_activate_vt (ply_terminal_t *terminal);
bool ply_terminal_deactivate_vt (ply_terminal_t *terminal);