Add bare +altgr/-altgr modifier support to kblayout-compiler(1)

This commit is contained in:
Juhani Krekelä 2021-04-18 18:05:09 +03:00
parent a83072bc3e
commit eaa7732901
1 changed files with 18 additions and 0 deletions

View File

@ -49,6 +49,20 @@ bool accept_no_shift(uint32_t combination)
return true;
}
bool accept_no_altgr(uint32_t combination)
{
if ( combination & 0b0100 )
return false;
return true;
}
bool accept_altgr(uint32_t combination)
{
if ( !(combination & 0b0100) )
return false;
return true;
}
bool accept_no_shift_no_alt_gr(uint32_t combination)
{
if ( combination & 0b0101 )
@ -529,6 +543,10 @@ int main(int argc, char* argv[])
line[--line_length] = '\0';
if ( !strcmp(line, "-shift") )
condition = accept_no_shift;
else if ( !strcmp(line, "-altgr") )
condition = accept_no_altgr;
else if ( !strcmp(line, "+altgr") )
condition = accept_altgr;
else if ( !strcmp(line, "-shift & -altgr") )
condition = accept_no_shift_no_alt_gr;
else if ( !strcmp(line, "+shift & -altgr") )