add shift indicator (WIP)
This commit is contained in:
parent
f81dd12d7e
commit
49b4a863fe
|
@ -29,10 +29,11 @@ static int callback_keypoll(void) {
|
|||
int main(void) {
|
||||
const int timer = timer_configure(TIMER_ANY, 15625, GINT_CALL(callback_keypoll));
|
||||
int tick_ctr = 0;
|
||||
int shift_state = 0;
|
||||
|
||||
while (1) {
|
||||
tgrid_sets(1, 0, C_WHITE, C_BLACK, LOREM_IPSUM);
|
||||
set_statusbar(tick_ctr);
|
||||
set_statusbar(tick_ctr, shift_state);
|
||||
set_menubar();
|
||||
tgrid_display();
|
||||
|
||||
|
|
7
src/ui.c
7
src/ui.c
|
@ -6,14 +6,17 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
void set_statusbar(int tick_ctr) {
|
||||
void set_statusbar(int tick_ctr, int shfit_state) {
|
||||
// set green bar
|
||||
for (int i = 0; i < UNS_TERM_COLS; i++)
|
||||
tgrid_sets(0, i, C_NONE, C_GREEN, " ");
|
||||
|
||||
// then add actutal text
|
||||
char statusbar[UNS_TERM_COLS + 1];
|
||||
sprintf(statusbar, "↑Aa %d", tick_ctr);
|
||||
if (shfit_state)
|
||||
sprintf(statusbar, "↑Aa %d", tick_ctr);
|
||||
else
|
||||
sprintf(statusbar, "_Aa %d", tick_ctr);
|
||||
tgrid_sets(0, 0, C_BLACK, C_GREEN, statusbar);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue