wctltya Posted December 9, 2016 Report Share Posted December 9, 2016 Hi, How I can change the actual key set of the virtual keyboard layout? Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted December 9, 2016 Report Share Posted December 9, 2016 You can change the layout by using gwinKeyboardSetLayout(). The function takes a pointer to a GVKeyTable struct which contains the layout. The struct is declared in /src/gwin/gwin_keyboard_layout.h and you can have a look at the existing layout(s) which are defined in /src/gwin/gwin_keyboard_layout.c. Link to comment Share on other sites More sharing options...
wctltya Posted December 14, 2016 Author Report Share Posted December 14, 2016 I saw it (gwinKeyboardSetLayout()) , but its about the layout, isn't it, while I'm asking for the key sets. As I understood, reading the gwin_keyboard_layout.c & .h files, a particular layout (eg. VirtualKeyboard_English1) consists of several key sets (eg. Eng1Set0 to Eng1Set4 for VirtualKeyboard_English1). So I'm looking for a way to switch between them. For example that virtual keyboard appears with Eng1Set0 Quote GVKeySet number 0 is special in that it is the default GVKeySet when the keyboard is first displayed. But what if I would like to appears/switch to Eng1Set1? I know that the user can scroll the key sets using the special key, even I didn't saw it in action because my touch screen is not fully operational yet(still working with a mock up), but how to control that from code? Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted December 14, 2016 Report Share Posted December 14, 2016 Okay, I'm a bit confused on what your actual question/problem is. Before we continue on this: Is your question how you can change a key set of the existing pre-defined built-in English1 layout or is your question on how you can change the currently displayed key set programmatically? Link to comment Share on other sites More sharing options...
wctltya Posted December 14, 2016 Author Report Share Posted December 14, 2016 Sorry for confusion. My question is: How I can change the currently displayed key set programmatically? Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted December 14, 2016 Report Share Posted December 14, 2016 There's currently no high-level API for that. I didn't check the code and I don't have everything in my head but I guess you should be able to just manually modify the keyset member of the GKeyboardObject directly and then issuing a redraw. This would look something like this (untested code): GHandle ghVirtualKeyboard; ghVirtualKeyboard = gwinKeyboardCreate(...); (GKeyboardObject*)ghVirtualKeyboard->keyset = <your new keyset> gwinRedraw(ghVirtualKeyboard); Link to comment Share on other sites More sharing options...
wctltya Posted December 14, 2016 Author Report Share Posted December 14, 2016 OK, thanks. I'll check it. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted December 14, 2016 Report Share Posted December 14, 2016 Let us know whether that works, we'll look into consider adding actual high-level API for that. Link to comment Share on other sites More sharing options...
wctltya Posted December 15, 2016 Author Report Share Posted December 15, 2016 (edited) Hi Joel, Can't access keyset. On 12/14/2016 at 14:00, Joel Bodenmann said: (GKeyboardObject*)ghVirtualKeyboard->keyset Compiler error - " 'struct GWindowObject' has no member named 'keyset' " More () are needed. ((GKeyboardObject *)ghVirtualKeyboard)->keyset But it works with the following: ((GKeyboardObject *)ghVirtualKeyboard)->keyset = ((GKeyboardObject *)ghVirtualKeyboard)->keytable->ksets[N]; where of course 'N' is in the keyset table range, 0 to 4 for the VirtualKeyboard_English1 Edited December 15, 2016 by wctltya Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted December 15, 2016 Report Share Posted December 15, 2016 Glad to hear that you got it working! Yes it's correct that the code I supplied contains a syntax fault. I tapped it during a bus ride on my phone so... 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