Skip to contentSkip to conversation

U+f000 and above

kbd Applied Michael Schutte 2 participants 4 messages Nov 9, 2008 – Nov 18, 2008

lore
Share & tools
lore
#0 lore raw

Alexey,

Do you agree with me that it would make sense to make loadkeys fail (or at least warn the user) on U+xxxx keysym specifications >= 0xf000? Currently, these will simply be seen by the kernel as non-Unicode syms, which is confusing at best.

As far as I can tell, there are no widespread keymap files which use this feature.

Cheers,

Signature · 1 line
Michael Schutte <[email protected]>
#1 lore raw
Quoted 4 lines · Michael Schutte

Alexey,

Do you agree with me that it would make sense to make loadkeys fail (or at least warn the user) on U+xxxx keysym specifications >= 0xf000?

I agree. This is a good idea.

Signature · 1 line
Rgrds, legion
#2 lore raw
Quoted 4 lines · Alexey Gladkov
Quoted 2 lines

Do you agree with me that it would make sense to make loadkeys fail (or at least warn the user) on U+xxxx keysym specifications >= 0xf000?

I agree. This is a good idea.

Okay then, this does the trick:

src/analyze.l +1 -1
index f55c676..392c9aa 100644
@@ -90,7 +90,7 @@ To                      to|To|TO
 \-                     {return(DASH);}
 \,                     {return(COMMA);}
 \+                     {return(PLUS);}
-{Unicode}              {yylval=strtol(yytext+1,NULL,16);return(UNUMBER);}
+{Unicode}              {yylval=strtol(yytext+1,NULL,16);if(yylval>=0xf000)lkfatal1("unicode keysym out of range: %s",yytext);return(UNUMBER);}
 {Decimal}|{Octal}|{Hex}        {yylval=strtol(yytext,NULL,0);return(NUMBER);}
 <RVALUE>{Literal}      {return((yylval=ksymtocode(yytext))==-1?ERROR:LITERAL);}
 

Sorry for the ugliness, I just sticked to the prevailing coding style in analyze.l. Re-format as you wish :-)

Signature · 1 line
Michael Schutte <[email protected]>
#3 lore raw
Quoted 2 lines · Michael Schutte

Sorry for the ugliness, I just sticked to the prevailing coding style in analyze.l. Re-format as you wish :-)

Applied, thanks!

Signature · 1 line
Rgrds, legion