2007-06-10, 22:31
Hi alltogether!
I have a new nice media center keyboard with integrated trackball and some media keys (http://www.speedlink.de/prod.php?lang=de...L-6495-SSV Speed-Link SL-6495-SSV Media Centre Controlboard). It has a german layout and german special keys like german umlauts. The hardware nearly works perfectly. Unfortunately xbmc doesn't support international keyboards and unicode input (only english keyboard layout and ascii).
I know C++, I have but I don't know xbmc-source and don't have and know xdk and MS VC++. Nevertheless I want to and hope am able to add support for my keyboard and not only for my keyboard but also for other international keyboards, media keys and perhaps unicode in a reasonable way, i.e. I don't want to invest months of work into this. Therefore I search a quick/simple solution. I dont' want to memorize all inner workings and rework whole xbmc source and libraries(?) ;-)
I have linux and gcc and assume I will be able to compile my code, but I am not able to build and test xbmc on my own. I need support for several reasons and hope to get it.
In this thread I want to sketch and discuss such a solution and hope to get some hints from you, so that I avoid meanders, but I won't wait till this discussion ends, I will start immediately with the following solution.
I already talked to jmarshall and found out, that the following things are already available in xbmc:
* XBoxKeyboard (trunk): support for keyboards connected to xbox (via XDK)
* DirectInputKeyboard (trunk): support for keyboards (via win32)
* SDLKeyboard (linux port branch): support for keyboards via SDL-Framework (via win32?)
* All implement the same class CKeyboard with nearly the same signature/interface. I assume they are bound at build time (not by runtime configuration, separate interface and factory).
I hope that all (especially the XBoxKeyboard) support direct access to so called scancodes (low level representation of the physical keys). This seems to be the most important thing to be able to add support for international keyboards.
I documented some inner workings in the wiki:
http://www.xboxmediacenter.com/wiki/inde...nalisation
I think the following requirements are relevant, not necessarily all implemented (only wishes):
* mapping of any key press to any xbmc action
* support keyboards that don't have english layout (correct international layout of a-z, A-Z, 1-0 etc.)
* support additional multimedia keys (model or individual configuration)
* support special national keys and characters (german umlauts etc.)
* support customization of key combinations (e.g. 'ALT GR' + 'Q' for '@' on german keyboards)
* support unicode characters (german umlauts maybe mapped to latin-1 codepage but that does not work for all international characters, e.g. it does not work for the dutch 'ij' with decimal code 307)
* allow national, model and individual configuration in an xml-file
* one solution for all plattforms (xbox, win32, linux or XBoxKeybaord, DirectInputKeyboard and SDLKeyboard respectively; program it only once for all)
Following is a solution sketch:
* abstract all low level differences between different plattforms/implementations behind a common interface other than CKeyboard
* this interface contains scancodes, english layout and ascii characters
* add all additional features on top of that interface in class CKeyboard
* use this new class CKeybaord with additional features instead of the old class cKeybaord mentioned above
* dont' remove current ascii feature foremost, to be backwards compatible
* put new unicode feature alongside of ascii, to enable the new feature, but this still requires further work to use it and I don't know how much work till now, to use it throughout in xbmc
* create new keyboardlayout.xml and put one of it into each language specific folder
* At the beginning the configuration for an english keyboard is default for every language. Other languages could be added/modified subsequently. Model specific or individual/personal customizations are always possible additionally and can be collected and exchanged elsewhere.
* Such an XML could look like this:
<keyboardlayout>
<kc48>1</kc48> <!-- map physical key wich keycode/scancode 48 to character '1' -->
<kcxxx>0x1B</kcxxx> <!-- map physical key with scancode xxx key to vkey 0x1B -->
<kcyyy>p</kcyyy> <!-- map multimedia play key with scancode yyy to ascii p -->
<kczzz>0x0133</kczzz> <!-- map physical key with scancode zzz to dutch unicode character 'ij' -->
<shift>
<kc48>!</kc48> <!-- map physical key with keycode/scancode 48 in combination with shift key to character '!' -->
<kcyyy>x</kcyyy> <!-- map multimedia play key in combination with shift to ascii x (stop) -->
</shift>
<ctrlshift>
...
</ctrlshift>
</keyboardlayout>
* read the xml for the current language, generate an internal map of physical keys to logical keys/characters
* use that map in the class with additional features
open questions to XDK functionality:
1. Are VirtualKeys representations of the physical keys, e.g. "main-enter" and "numpad-enter" separated or are they already translated to "logical" functions like "only one enter"?
2. Are VirtualKeys always "filled" even if ascii is "filled"?
I'm sure more questions will arise.
What do you think of the solution? Can you answer my other questions? And who can help me build xbmc and test it?
Best regards
webbanane
I have a new nice media center keyboard with integrated trackball and some media keys (http://www.speedlink.de/prod.php?lang=de...L-6495-SSV Speed-Link SL-6495-SSV Media Centre Controlboard). It has a german layout and german special keys like german umlauts. The hardware nearly works perfectly. Unfortunately xbmc doesn't support international keyboards and unicode input (only english keyboard layout and ascii).
I know C++, I have but I don't know xbmc-source and don't have and know xdk and MS VC++. Nevertheless I want to and hope am able to add support for my keyboard and not only for my keyboard but also for other international keyboards, media keys and perhaps unicode in a reasonable way, i.e. I don't want to invest months of work into this. Therefore I search a quick/simple solution. I dont' want to memorize all inner workings and rework whole xbmc source and libraries(?) ;-)
I have linux and gcc and assume I will be able to compile my code, but I am not able to build and test xbmc on my own. I need support for several reasons and hope to get it.
In this thread I want to sketch and discuss such a solution and hope to get some hints from you, so that I avoid meanders, but I won't wait till this discussion ends, I will start immediately with the following solution.
I already talked to jmarshall and found out, that the following things are already available in xbmc:
* XBoxKeyboard (trunk): support for keyboards connected to xbox (via XDK)
* DirectInputKeyboard (trunk): support for keyboards (via win32)
* SDLKeyboard (linux port branch): support for keyboards via SDL-Framework (via win32?)
* All implement the same class CKeyboard with nearly the same signature/interface. I assume they are bound at build time (not by runtime configuration, separate interface and factory).
I hope that all (especially the XBoxKeyboard) support direct access to so called scancodes (low level representation of the physical keys). This seems to be the most important thing to be able to add support for international keyboards.
I documented some inner workings in the wiki:
http://www.xboxmediacenter.com/wiki/inde...nalisation
I think the following requirements are relevant, not necessarily all implemented (only wishes):
* mapping of any key press to any xbmc action
* support keyboards that don't have english layout (correct international layout of a-z, A-Z, 1-0 etc.)
* support additional multimedia keys (model or individual configuration)
* support special national keys and characters (german umlauts etc.)
* support customization of key combinations (e.g. 'ALT GR' + 'Q' for '@' on german keyboards)
* support unicode characters (german umlauts maybe mapped to latin-1 codepage but that does not work for all international characters, e.g. it does not work for the dutch 'ij' with decimal code 307)
* allow national, model and individual configuration in an xml-file
* one solution for all plattforms (xbox, win32, linux or XBoxKeybaord, DirectInputKeyboard and SDLKeyboard respectively; program it only once for all)
Following is a solution sketch:
* abstract all low level differences between different plattforms/implementations behind a common interface other than CKeyboard
* this interface contains scancodes, english layout and ascii characters
* add all additional features on top of that interface in class CKeyboard
* use this new class CKeybaord with additional features instead of the old class cKeybaord mentioned above
* dont' remove current ascii feature foremost, to be backwards compatible
* put new unicode feature alongside of ascii, to enable the new feature, but this still requires further work to use it and I don't know how much work till now, to use it throughout in xbmc
* create new keyboardlayout.xml and put one of it into each language specific folder
* At the beginning the configuration for an english keyboard is default for every language. Other languages could be added/modified subsequently. Model specific or individual/personal customizations are always possible additionally and can be collected and exchanged elsewhere.
* Such an XML could look like this:
<keyboardlayout>
<kc48>1</kc48> <!-- map physical key wich keycode/scancode 48 to character '1' -->
<kcxxx>0x1B</kcxxx> <!-- map physical key with scancode xxx key to vkey 0x1B -->
<kcyyy>p</kcyyy> <!-- map multimedia play key with scancode yyy to ascii p -->
<kczzz>0x0133</kczzz> <!-- map physical key with scancode zzz to dutch unicode character 'ij' -->
<shift>
<kc48>!</kc48> <!-- map physical key with keycode/scancode 48 in combination with shift key to character '!' -->
<kcyyy>x</kcyyy> <!-- map multimedia play key in combination with shift to ascii x (stop) -->
</shift>
<ctrlshift>
...
</ctrlshift>
</keyboardlayout>
* read the xml for the current language, generate an internal map of physical keys to logical keys/characters
* use that map in the class with additional features
open questions to XDK functionality:
1. Are VirtualKeys representations of the physical keys, e.g. "main-enter" and "numpad-enter" separated or are they already translated to "logical" functions like "only one enter"?
2. Are VirtualKeys always "filled" even if ascii is "filled"?
I'm sure more questions will arise.
What do you think of the solution? Can you answer my other questions? And who can help me build xbmc and test it?
Best regards
webbanane