mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-22 00:07:46 +00:00
fix(developer): support for smp names
This commit is contained in:
parent
17c94770ef
commit
1fcfefa3cf
3 changed files with 5 additions and 3 deletions
|
|
@ -2458,7 +2458,7 @@ DWORD GetXString(PFILE_KEYBOARD fk, PWSTR str, PWSTR token, PWSTR output, int ma
|
|||
case 16:
|
||||
VERIFY_KEYBOARD_VERSION(fk, VERSION_60, CERR_60FeatureOnly_NamedCodes);
|
||||
q = p + 1;
|
||||
while (iswalnum(*q) || *q == '-' || *q == '_') q++;
|
||||
while (*q && !iswblank(*q)) q++;
|
||||
c = *q; *q = 0;
|
||||
n = CodeConstants->GetCode(p + 1, &i);
|
||||
*q = c;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ void NamedCodeConstants::AddCode(int n, const wchar_t *p, DWORD storeIndex)
|
|||
entries_file[nEntries_file].name[MAX_ENAME] = 0;
|
||||
|
||||
for (wchar_t *r = entries_file[nEntries_file].name; *r; r++)
|
||||
if (!iswalnum(*r) && *r != '-') *r = '_';
|
||||
if (iswblank(*r) && *r != '-') *r = '_';
|
||||
|
||||
entries_file[nEntries_file].storeIndex = storeIndex;
|
||||
nEntries_file++;
|
||||
|
|
@ -101,7 +101,7 @@ void NamedCodeConstants::AddCode_IncludedCodes(int n, const wchar_t *p)
|
|||
wcsncpy_s(entries[nEntries].name, _countof(entries[nEntries].name), p, MAX_ENAME); // I3481
|
||||
entries[nEntries].name[MAX_ENAME] = 0;
|
||||
for (wchar_t *r = entries[nEntries].name; *r; r++)
|
||||
if (!iswalnum(*r) && *r != '-') *r = '_';
|
||||
if (iswblank(*r)) *r = '_';
|
||||
|
||||
entries[nEntries].storeIndex = 0xFFFFFFFFL;
|
||||
nEntries++;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ store(&includecodes) 'test_namedcodeconstants.txt'
|
|||
store(főő) '0'
|
||||
store(bar) '1'
|
||||
store(smp) U+12345
|
||||
store(😉) '🤪'
|
||||
|
||||
$főő + 'a' > 'b'
|
||||
$bar + 'a' > 'c'
|
||||
|
|
@ -21,3 +22,4 @@ $hangul_syllable_go + 'a' > 'd'
|
|||
$mycode + 'a' > 'e'
|
||||
|
||||
$smp + 'a' > 'f'
|
||||
$😉 + 'a' > '😡'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue