Skip to content

Commit

Permalink
Add other known keyboard layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
colinleroy committed Jul 12, 2023
1 parent b431e61 commit 8c2643d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/mastodon/api/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ extern char endpoint_buf[ENDPOINT_BUF_SIZE];
extern char *tl_endpoints[3];
extern char *tl_filter[3];

/* FIXME make that configurable */
/* Refs: https://www.aivosto.com/articles/charsets-7bit.html
* and https://archive.org/details/Apple_IIgs_Hardware_Reference_HiRes/page/n275/mode/1up?view=theater
* FIXME make that configurable */
#define US_CHARSET "US-ASCII"
#define FR_CHARSET "ISO646-FR1"
#define ES_CHARSET "ISO646-ES"
#define IT_CHARSET "ISO646-IT"
#define DE_CHARSET "ISO646-DE"

#define SELECTOR_SIZE 255
extern char selector[SELECTOR_SIZE];
Expand Down
18 changes: 15 additions & 3 deletions src/mastodon/cli/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ static char *cli() {
print_logo(scrw);

cputs("Please choose your keyboard layout:\r\n");
cputs("0. US QWERTY ("US_CHARSET" charset)\r\n");
cputs("1. French AZERTY ("FR_CHARSET" charset)\r\n");

cputs("0. US ("US_CHARSET" charset)\r\n");
cputs("1. French ("FR_CHARSET" charset)\r\n");
cputs("2. Spanish ("ES_CHARSET" charset)\r\n");
cputs("3. Italian ("IT_CHARSET" charset)\r\n");
cputs("4. German ("DE_CHARSET" charset)\r\n");

charset_again:
c = cgetc();
switch(c) {
Expand All @@ -68,6 +71,15 @@ static char *cli() {
case '1':
charset = FR_CHARSET;
break;
case '2':
charset = ES_CHARSET;
break;
case '3':
charset = IT_CHARSET;
break;
case '4':
charset = DE_CHARSET;
break;
default:
goto charset_again;
}
Expand Down

0 comments on commit 8c2643d

Please sign in to comment.