From bba06a7f19a17af96f1897e8125496f0a57ab222 Mon Sep 17 00:00:00 2001 From: Vadim Grigoruk Date: Thu, 9 Aug 2018 18:08:02 +0300 Subject: [PATCH] #571 added alt labels --- src/kbdlabels.inl | 42 +++++++++++++++++++++--------------------- src/system.c | 9 +++++---- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/kbdlabels.inl b/src/kbdlabels.inl index faf2b8d..255e33e 100644 --- a/src/kbdlabels.inl +++ b/src/kbdlabels.inl @@ -12,27 +12,27 @@ {"F10", 20*8+3, 0*8+3, true}, {"TAB", 0*8+3, 2*8+4, true}, -{"`", 2*8+3, 2*8+3}, -{"[", 4*8+3, 2*8+3}, -{"]", 6*8+3, 2*8+3}, -{";", 8*8+3, 2*8+3}, -{"'", 10*8+3, 2*8+3}, -{"-", 12*8+3, 2*8+3}, -{"=", 14*8+3, 2*8+3}, -{"/", 16*8+3, 2*8+3}, +{"`", 2*8+3, 2*8+3, false, "~"}, +{"[", 4*8+3, 2*8+3, false, "{"}, +{"]", 6*8+3, 2*8+3, false, "}"}, +{";", 8*8+3, 2*8+3, false, ":"}, +{"'", 10*8+3, 2*8+3, false, "\""}, +{"-", 12*8+3, 2*8+3, false, "_"}, +{"=", 14*8+3, 2*8+3, false, "+"}, +{"/", 16*8+3, 2*8+3, false, "?"}, {"F11", 18*8+3, 2*8+3, true}, {"F12", 20*8+3, 2*8+3, true}, -{"1", 0*8+3, 4*8+3}, -{"2", 2*8+3, 4*8+3}, -{"3", 4*8+3, 4*8+3}, -{"4", 6*8+3, 4*8+3}, -{"5", 8*8+3, 4*8+3}, -{"6", 10*8+3, 4*8+3}, -{"7", 12*8+3, 4*8+3}, -{"8", 14*8+3, 4*8+3}, -{"9", 16*8+3, 4*8+3}, -{"0", 18*8+3, 4*8+3}, +{"1", 0*8+3, 4*8+3, false, "!"}, +{"2", 2*8+3, 4*8+3, false, "@"}, +{"3", 4*8+3, 4*8+3, false, "#"}, +{"4", 6*8+3, 4*8+3, false, "$"}, +{"5", 8*8+3, 4*8+3, false, "%"}, +{"6", 10*8+3, 4*8+3, false, "^"}, +{"7", 12*8+3, 4*8+3, false, "&"}, +{"8", 14*8+3, 4*8+3, false, "*"}, +{"9", 16*8+3, 4*8+3, false, "("}, +{"0", 18*8+3, 4*8+3, false, ")"}, {"BAC", 20*8+3, 4*8+4, true}, {"Q", 0*8+3, 6*8+3}, @@ -45,7 +45,7 @@ {"I", 14*8+3, 6*8+3}, {"O", 16*8+3, 6*8+3}, {"P", 18*8+3, 6*8+3}, -{"\\", 20*8+3, 6*8+3}, +{"\\", 20*8+3, 6*8+3, false, "|"}, {"A", 1*8+3, 8*8+3}, {"S", 3*8+3, 8*8+3}, @@ -65,8 +65,8 @@ {"B", 10*8+3, 10*8+3}, {"N", 12*8+3, 10*8+3}, {"M", 14*8+3, 10*8+3}, -{",", 16*8+3, 10*8+3}, -{".", 18*8+3, 10*8+3, true}, +{",", 16*8+3, 10*8+3, false, "<"}, +{".", 18*8+3, 10*8+3, false, ">"}, {"CTRL", 0*8+5, 12*8+4, true}, {"ALT", 3*8+6, 12*8+4, true}, diff --git a/src/system.c b/src/system.c index eb1ccbe..99712c4 100644 --- a/src/system.c +++ b/src/system.c @@ -172,9 +172,7 @@ static void drawKeyboardLabels(s32 shift) { tic_mem* tic = platform.studio->tic; - enum{Color = tic_color_dark_gray}; - - typedef struct {const char* text; s32 x; s32 y; bool alt;} Label; + typedef struct {const char* text; s32 x; s32 y; bool alt; const char* shift;} Label; static const Label Labels[] = { #include "kbdlabels.inl" @@ -184,7 +182,10 @@ static void drawKeyboardLabels(s32 shift) { const Label* label = Labels + i; if(label->text) - tic->api.text(tic, label->text, label->x, label->y + shift, Color, label->alt); + tic->api.text(tic, label->text, label->x, label->y + shift, tic_color_dark_gray, label->alt); + + if(label->shift) + tic->api.fixed_text(tic, label->shift, label->x + 6, label->y + shift + 2, tic_color_light_blue, label->alt); } }