mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-05 07:07:41 +00:00
feat(linux): mcompile-dk use const wchar_t* in LogError
This commit is contained in:
parent
afb391fea7
commit
5d43f0a24e
5 changed files with 8 additions and 17 deletions
|
|
@ -6,8 +6,6 @@ Sample program that reads US basic keyboard and compares to key value group
|
|||
|
||||
# Keymap
|
||||
|
||||
__S2 TODO check if I can use files from some other keyman path instead of a copy here ( e.g. filesystem.h exists elsewhere); where can I use incxstr from
|
||||
_S2 TODO Do I need HKL for Linux / can I just use a void* or remove HKL ??, typeddef of KMX_HKL - can I delete all m_hkl from classes?
|
||||
_S2 TODO Check/find use of wchar_t/wstring and replace with char16_t/u16string
|
||||
_S2 TODO check call by reference/value
|
||||
_S2 TODO what is wrong with kp->dpBitmapOffset/BitmapSize ?
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include "keymap.h"
|
||||
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
// unmodified, shift, RALT, shift+RALT
|
||||
|
|
@ -530,7 +529,6 @@ KMX_DWORD KMX_get_KeyValUnderlying_From_KeyCodeUnderlying(GdkKeymap *keymap, UIN
|
|||
GdkKeymapKey *maps;
|
||||
guint *keyvals;
|
||||
gint count;
|
||||
KMX_DWORD deadkey=0;
|
||||
PKMX_WCHAR dky=NULL;
|
||||
|
||||
|
||||
|
|
@ -579,7 +577,7 @@ KMX_DWORD KMX_get_KeyCodeUnderlying_From_KeyCodeUS(GdkKeymap *keymap, v_dw_3D &A
|
|||
//Find KC_underlying character
|
||||
for( int i=0; i< (int)All_Vector[1].size()-1 ;i++) {
|
||||
for( int j=1; j< (int)All_Vector[1][0].size();j++) {
|
||||
if ( ( All_Vector[1][i][j] == *ws.c_str() ) ) {
|
||||
if ( ( All_Vector[1][i][j] == (KMX_DWORD) *ws.c_str() ) ) {
|
||||
KC_underlying = All_Vector[1][i][0];
|
||||
return KC_underlying;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -290,7 +290,6 @@ public:
|
|||
key->dpContext = new KMX_WCHAR[1];
|
||||
*key->dpContext = 0;
|
||||
|
||||
//key->ShiftFlags = this->KMX_GetShiftStateValue(capslock, caps, (ShiftState) ss);
|
||||
key->ShiftFlags = this->KMX_GetShiftStateValue(capslock, caps, (ShiftState) ss);
|
||||
// we already use VK_US so no need to convert it as we do on windows
|
||||
key->Key = this->VK();
|
||||
|
|
@ -328,8 +327,6 @@ public:
|
|||
key->Line = 0;
|
||||
key->ShiftFlags = this->KMX_GetShiftStateValue(capslock, caps, (ShiftState) ss);
|
||||
|
||||
//wprintf(L"capslock = %i, shiftflgs= %i \n", capslock, key->ShiftFlags );
|
||||
|
||||
key->dpContext = new KMX_WCHAR;
|
||||
*key->dpContext = 0;
|
||||
p = key->dpOutput = new KMX_WCHAR[st.size() + 1];
|
||||
|
|
@ -395,7 +392,6 @@ bool KMX_ImportRules(LPKMX_KEYBOARD kp,v_dw_3D &All_Vector, GdkKeymap **keymap,
|
|||
|
||||
//KMX_HKL hkl = NULL;
|
||||
|
||||
BYTE lpKeyState[256];// = new KeysEx[256];
|
||||
std::vector<KMX_VirtualKey*> rgKey; //= new VirtualKey[256];
|
||||
std::vector<DeadKey*> alDead;
|
||||
std::vector<DeadKey*> alDead_cpl = create_alDead();
|
||||
|
|
@ -452,7 +448,7 @@ bool KMX_ImportRules(LPKMX_KEYBOARD kp,v_dw_3D &All_Vector, GdkKeymap **keymap,
|
|||
|
||||
if(rc > 0) {
|
||||
if(*sbBuffer == 0) {
|
||||
//rgKey[iKey]->KMX_SetShiftState(ss, L"", false, (caps == 0)); // _S2 TOP_6 INFO
|
||||
//rgKey[iKey]->KMX_SetShiftState(ss, L"", false, (caps == 0)); // different to windows since behavior on Linux is different
|
||||
rgKey[iKey]->KMX_SetShiftState(ss, L"", false, (caps));
|
||||
}
|
||||
else {
|
||||
|
|
@ -461,13 +457,13 @@ bool KMX_ImportRules(LPKMX_KEYBOARD kp,v_dw_3D &All_Vector, GdkKeymap **keymap,
|
|||
}
|
||||
sbBuffer[rc] = 0;
|
||||
//rgKey[iKey]->KMX_SetShiftState(ss, sbBuffer, false, (caps==0));
|
||||
rgKey[iKey]->KMX_SetShiftState(ss, sbBuffer, false, (caps)); //_S2 TOP_6 INFO
|
||||
rgKey[iKey]->KMX_SetShiftState(ss, sbBuffer, false, (caps)); // different to windows since behavior on Linux is different
|
||||
}
|
||||
}
|
||||
else if(rc < 0) {
|
||||
sbBuffer[2] = 0;
|
||||
//rgKey[iKey]->SetShiftState(ss, sbBuffer, true, (caps == 0));
|
||||
rgKey[iKey]->KMX_SetShiftState(ss, sbBuffer, true, (caps )); //_S2 TOP_6 INFO
|
||||
rgKey[iKey]->KMX_SetShiftState(ss, sbBuffer, true, (caps )); // different to windows since behavior on Linux is different
|
||||
|
||||
refine_alDead(sbBuffer[0], alDead, &alDead_cpl);
|
||||
}
|
||||
|
|
@ -564,7 +560,6 @@ bool KMX_ImportRules(LPKMX_KEYBOARD kp,v_dw_3D &All_Vector, GdkKeymap **keymap,
|
|||
UINT j;
|
||||
LPKMX_KEY kkp;
|
||||
for(j = 0, kkp = gp->dpKeyArray; j < gp->cxKeyArray; j++, kkp++) {
|
||||
// _S2 TOP_2 0110 1111
|
||||
if((kkp->ShiftFlags & (K_CTRLFLAG|K_ALTFLAG|LCTRLFLAG|LALTFLAG|RCTRLFLAG|RALTFLAG)) != 0) {
|
||||
gp2->cxKeyArray++;
|
||||
LPKMX_KEY kkp2 = new KMX_KEY[gp2->cxKeyArray];
|
||||
|
|
|
|||
|
|
@ -476,10 +476,10 @@ int KMX_GetDeadkeys(v_dw_2D & dk_Table, KMX_WORD DeadKey, KMX_WORD *OutputPairs,
|
|||
return (p-OutputPairs);
|
||||
}
|
||||
|
||||
void KMX_LogError(PWCHAR fmt, ...) {
|
||||
void KMX_LogError(const wchar_t* fmt, ...) {
|
||||
WCHAR fmtbuf[256];
|
||||
wchar_t *end = L"\0";
|
||||
wchar_t *nl = L"\n";
|
||||
const wchar_t* end = L"\0";
|
||||
const wchar_t* nl = L"\n";
|
||||
va_list vars;
|
||||
int j=0;
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,6 @@ PKMX_WCHAR KMX_incxstr(PKMX_WCHAR p);
|
|||
|
||||
int KMX_GetDeadkeys(v_dw_2D & dk_Table, KMX_WORD DeadKey, KMX_WORD *OutputPairs, GdkKeymap* keymap);
|
||||
|
||||
void KMX_LogError(PWCHAR fmt, ...) ;
|
||||
void KMX_LogError(const wchar_t* fmt, ...);
|
||||
|
||||
#endif /*MCOMPILE_H*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue