GTK+UTF-8+UNICODE= Key event проблемка.
GTK+UTF-8+UNICODE= Key event проблемка.
Привет братцы.
Очень рад увидеть здесь раздел для русскоязычных.
Повторю свой вопрос по-русски. По-английски никто не ответил.
wxWidgets 2.8.6 GTK сборка под ubuntu 7.10 юникод.
(вообще этот глюк везде в wxwidgets есть в линуксах)
Берем собираем sample "keyboard".
Переключаемся на русский. В ивент от нажатия русских букв приходит байда:
"Char event:NUL (flags = ----) (raw key code/flags: 3213029900 and 0x0)"
Key event-а вообще нет.
В английской раскладке естественно все ок. Оба ивента и как положено.
Вообще много вопросов под линуксом - много чего не работает.
В основном писали под вин32 - сейчас портанули проект под wxGTK - все вообщем то работает - но куча мелочей - типа этого.
Очень рад увидеть здесь раздел для русскоязычных.
Повторю свой вопрос по-русски. По-английски никто не ответил.
wxWidgets 2.8.6 GTK сборка под ubuntu 7.10 юникод.
(вообще этот глюк везде в wxwidgets есть в линуксах)
Берем собираем sample "keyboard".
Переключаемся на русский. В ивент от нажатия русских букв приходит байда:
"Char event:NUL (flags = ----) (raw key code/flags: 3213029900 and 0x0)"
Key event-а вообще нет.
В английской раскладке естественно все ок. Оба ивента и как положено.
Вообще много вопросов под линуксом - много чего не работает.
В основном писали под вин32 - сейчас портанули проект под wxGTK - все вообщем то работает - но куча мелочей - типа этого.
Last edited by esp on Wed Mar 26, 2008 9:17 am, edited 1 time in total.
The same.ONEEYEMAN wrote:In K (GNOME,FireFox,...) set the initial keyboard layout to Russian.
Start the program, test it then change the layout to English while the program runs.
In screenshot I pressed key '1' and then 'q' in Russian layout.
wxGTK complited with "configure --with-gtk --enable-unicode --with-gnome-print --with-gnomeprintui"
BTW, in sources wxGTK - how i can grab messages from wxLogTrace?
May be I'll fix it.
WBW.
Everything ok. All events from all keys fine.ONEEYEMAN wrote:OK,
2 questions:
1. What happen if you start the app with English keyboard?
First of all, events from keys which switch layout (for example Ctrl-Shift) then digits and func keys works fine - keys with letters dont send key events at all and char NUL events.2. What hapen if you change the layout from Russian to English during the app run?
If switch back in English layout - everything fine with keys.
Another words, key events does not work with russian layout from letters keys.
P.S.:
Finally I found why.
/wxGTK-2.8.7/src/gtk/window.cpp
static inline bool wxIsAsciiKeysym(KeySym ks)
{
return ks < 256;
}
This is incorrect for russian keys.
and
// These are used when transforming Ctrl-alpha to ascii values 1-26
inline bool wxIsLowerChar(int code)
{
return (code >= 'a' && code <= 'z' );
}
inline bool wxIsUpperChar(int code)
{
return (code >= 'A' && code <= 'Z' );
}
and in gtk_wxwindow_commit_cb
for( const wxChar* pstr = data; *pstr; pstr++ )
{
#if wxUSE_UNICODE
event.m_uniChar = *pstr;
// Backward compatible for ISO-8859-1
event.m_keyCode = *pstr < 256 ? event.m_uniChar : 0;
wxLogTrace(TRACE_KEYS, _T("IM sent character '%c'"), event.m_uniChar);
#else
event.m_keyCode = *pstr;
#endif // wxUSE_UNICODE
Why 256???
P.P.S:
I set to 10240 these two places and look at it!!!
All you need is either post to [email protected] or submit a bug at https://sourceforge.net/tracker/?group_ ... tid=109863 with the patch that resolves it.
Thank you.
P.S.: Also check the trunk. Maybe it's already fixed there...
Thank you.
P.S.: Also check the trunk. Maybe it's already fixed there...