Add support for umlauts in input fields.

This commit is contained in:
Johns 2014-01-08 16:57:08 +01:00
parent aee9bbed90
commit 978fc59aba
5 changed files with 25 additions and 12 deletions

View File

@ -1,6 +1,7 @@
User johns User johns
Date: Date:
Add support for umlauts in input fields.
Fix compile error with VDR 2.1.3. Fix compile error with VDR 2.1.3.
Fix bug: memory leak. Fix bug: memory leak.
PIP close clears the last used PIP channel. PIP close clears the last used PIP channel.

View File

@ -1,7 +1,7 @@
/// ///
/// @file softhddev.h @brief software HD device plugin header file. /// @file softhddev.h @brief software HD device plugin header file.
/// ///
/// Copyright (c) 2011 - 2013 by Johns. All Rights Reserved. /// Copyright (c) 2011 - 2014 by Johns. All Rights Reserved.
/// ///
/// Contributor(s): /// Contributor(s):
/// ///
@ -25,7 +25,8 @@ extern "C"
{ {
#endif #endif
/// C callback feed key press /// C callback feed key press
extern void FeedKeyPress(const char *, const char *, int, int); extern void FeedKeyPress(const char *, const char *, int, int,
const char *);
/// C plugin get osd size and ascpect /// C plugin get osd size and ascpect
extern void GetOsdSize(int *, int *, double *); extern void GetOsdSize(int *, int *, double *);

View File

@ -212,9 +212,10 @@ class cSoftRemote:public cRemote
** @param key pressed/released key name ** @param key pressed/released key name
** @param repeat repeated key flag ** @param repeat repeated key flag
** @param release released key flag ** @param release released key flag
** @param letter x11 character string (system setting locale)
*/ */
extern "C" void FeedKeyPress(const char *keymap, const char *key, int repeat, extern "C" void FeedKeyPress(const char *keymap, const char *key, int repeat,
int release) int release, const char *letter)
{ {
cRemote *remote; cRemote *remote;
cSoftRemote *csoft; cSoftRemote *csoft;
@ -237,9 +238,17 @@ extern "C" void FeedKeyPress(const char *keymap, const char *key, int repeat,
csoft = new cSoftRemote(keymap); csoft = new cSoftRemote(keymap);
} }
//dsyslog("[softhddev]%s %s, %s\n", __FUNCTION__, keymap, key); //dsyslog("[softhddev]%s %s, %s, %s\n", __FUNCTION__, keymap, key, letter);
if (key[1]) { // no single character if (key[1]) { // no single character
csoft->Put(key, repeat, release); if (!csoft->Put(key, repeat, release) && letter) {
cCharSetConv conv;
unsigned code;
code = Utf8CharGet(conv.Convert(letter));
if (code <= 0xFF) {
cRemote::Put(KBDKEY(code)); // feed it for edit mode
}
}
} else if (!csoft->Put(key, repeat, release)) { } else if (!csoft->Put(key, repeat, release)) {
cRemote::Put(KBDKEY(key[0])); // feed it for edit mode cRemote::Put(KBDKEY(key[0])); // feed it for edit mode
} }

View File

@ -1,7 +1,7 @@
/// ///
/// @file softhddevice.h @brief software HD device plugin header file. /// @file softhddevice.h @brief software HD device plugin header file.
/// ///
/// Copyright (c) 2011 by Johns. All Rights Reserved. /// Copyright (c) 2011, 2014 by Johns. All Rights Reserved.
/// ///
/// Contributor(s): /// Contributor(s):
/// ///

14
video.c
View File

@ -1,7 +1,7 @@
/// ///
/// @file video.c @brief Video module /// @file video.c @brief Video module
/// ///
/// Copyright (c) 2009 - 2013 by Johns. All Rights Reserved. /// Copyright (c) 2009 - 2014 by Johns. All Rights Reserved.
/// ///
/// Contributor(s): /// Contributor(s):
/// ///
@ -9526,7 +9526,7 @@ void VideoOsdExit(void)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
/// C callback feed key press /// C callback feed key press
extern void FeedKeyPress(const char *, const char *, int, int); extern void FeedKeyPress(const char *, const char *, int, int, const char *);
/// ///
/// Handle XLib I/O Errors. /// Handle XLib I/O Errors.
@ -9570,6 +9570,7 @@ static void VideoEvent(void)
KeySym keysym; KeySym keysym;
const char *keynam; const char *keynam;
char buf[64]; char buf[64];
char letter[64];
uint32_t values[1]; uint32_t values[1];
VideoThreadLock(); VideoThreadLock();
@ -9580,7 +9581,7 @@ static void VideoEvent(void)
Debug(3, "video/event: ClientMessage\n"); Debug(3, "video/event: ClientMessage\n");
if (event.xclient.data.l[0] == (long)WmDeleteWindowAtom) { if (event.xclient.data.l[0] == (long)WmDeleteWindowAtom) {
Debug(3, "video/event: wm-delete-message\n"); Debug(3, "video/event: wm-delete-message\n");
FeedKeyPress("XKeySym", "Close", 0, 0); FeedKeyPress("XKeySym", "Close", 0, 0, NULL);
} }
break; break;
@ -9609,7 +9610,7 @@ static void VideoEvent(void)
break; break;
case KeyPress: case KeyPress:
VideoThreadLock(); VideoThreadLock();
XLookupString(&event.xkey, buf, sizeof(buf), &keysym, NULL); XLookupString(&event.xkey, letter, sizeof(letter), &keysym, NULL);
VideoThreadUnlock(); VideoThreadUnlock();
if (keysym == NoSymbol) { if (keysym == NoSymbol) {
Warning(_("video/event: No symbol for %d\n"), Warning(_("video/event: No symbol for %d\n"),
@ -9632,7 +9633,7 @@ static void VideoEvent(void)
strncat(buf, keynam, sizeof(buf) - 10); strncat(buf, keynam, sizeof(buf) - 10);
keynam = buf; keynam = buf;
} }
FeedKeyPress("XKeySym", keynam, 0, 0); FeedKeyPress("XKeySym", keynam, 0, 0, letter);
break; break;
case KeyRelease: case KeyRelease:
break; break;
@ -11289,7 +11290,8 @@ void FeedKeyPress( __attribute__ ((unused))
const char *x, __attribute__ ((unused)) const char *x, __attribute__ ((unused))
const char *y, __attribute__ ((unused)) const char *y, __attribute__ ((unused))
int a, __attribute__ ((unused)) int a, __attribute__ ((unused))
int b) int b, __attribute__ ((unused))
const char *s)
{ {
} }