ForTest Posted June 30, 2016 Report Share Posted June 30, 2016 Hi Is it possible to change the layout of the widget "Keyboard" on the display to a numeric keypad? Thanks Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted June 30, 2016 Report Share Posted June 30, 2016 Yes that's possible. The layout of the virtual keyboard widget is fully customizable. You can create your custom layouts and use that. It's all a matter of properly configuring the layout structs. The easiest way to get this going is by looking at the implementation of the existing layout which you can find in the two files /src/gwin/gwin_keyboard_layout.[ch]. Once you created your own layout you can assign it using gwinKeyboardSetLayout(). Please show us a screenshot, photo, video or similar once you are done. We're very interested to see what you come up with Link to comment Share on other sites More sharing options...
ForTest Posted June 30, 2016 Author Report Share Posted June 30, 2016 Ok, thank you I also ask if it is possible to customize the widgets items for example the lighting color of a key pressed? Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted June 30, 2016 Report Share Posted June 30, 2016 Yes, that is possible too. Every widget is completely customizable. There are two different ways you can customize an existing widget: WidgetStyles and Custom Rendering Routine: In case of you like how the different available rendering routines of a widget look like and you just want to change the colors, you can simply assign a different WidgetStyle to that widget using gwinSetStyle() (or gwinSetDefaultStyle() if you want to use it for all/most widgets). If you'd like to have complete control over how a widget is being rendered you can create your own custom rendering routine in your application code and use gwinSetCustomDraw() to assign it to the widget. There is a complete article on the wiki (linked above) that explains step-by-step how a custom rendering routine can be implemented and used. Also, if you want to get one step further, it's possible to create custom widgets from scratch. That is explained here: http://wiki.ugfx.org/index.php/Creating_a_widget Link to comment Share on other sites More sharing options...
vova5049 Posted June 25, 2019 Report Share Posted June 25, 2019 Hello. I created my own keyboard layout in gwin_keyboard_layout.c. : static const GVSpecialKey Num1SKeys [] = { {"\ 001", 0, GVKEY_SINGLESET, 1}, // \ 001 (1) = Shift Lower to Upper {"\ 001", 0, GVKEY_INVERT | GVKEY_LOCKSET, 2}, // \ 002 (2) = Shift Upper to Upper Lock {"\ 002", 0, GVKEY_INVERT | GVKEY_LOCKSET, 0}, // \ 003 (3) = Shift Upper Lock to Lower {"123", 0, GVKEY_LOCKSET, 3}, // \ 004 (4) = Change to Numbers {"Delete", "\ b", 0, 0}, // \ 005 (5) = Backspace {"\ 015", "\ r", 0, 0}, // \ 006 (6) = Enter 1 {"\ 015", "\ r", 0, 0}, // \ 007 (7) = Enter 2 (Short keycap) {"Sym", 0, GVKEY_LOCKSET, 4}, // \ 010 (8) = Change to Symbols {"aA", 0, GVKEY_LOCKSET, 0}, // \ 011 (9) = Change to Lower Alpha }; static const char * NumSet0 [] = {"\ 005 \ 005 \ 005", "789", "456", "123", "00 \ 006", 0}; static const GVKeySet NumSets [] = {NumSet0, 0}; const GVKeyTable VirtualKeyboard_Num1 = {Num1SKeys, NumSets}; I am trying to call in my program gwinKeyboardSetLayout(& ghKeyboard, VirtualKeyboard_English1); but I'm getting an error when compiling: 'VirtualKeyboard_English1' undeclared (first use in this function) main.c But if in gfxconf.h I define: #define GWIN_KEYBOARD_DEFAULT_LAYOUT VirtualKeyboard_Num1 it works. What is the correct way to use gwinKeyboardSetLayout ()? Link to comment Share on other sites More sharing options...
vova5049 Posted June 25, 2019 Report Share Posted June 25, 2019 and in general I have a problem with understanding, for example how to make the keyboard appear when I press on the input field and hide when I press "enter" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now