This approach works with Build-A-Board layouts only when starting MYTSOFT.EXE - it does not allow you to change the layout from the already running process.
In MYTSOFT.EXE 2.10, you can select different layouts via a button using the CMD:NKBF (New KBF) if you want the user to switch on-the-fly. If you want to externally change the displayed layout on-the-fly, you need to do some dancing. It will make a bit more sense if I describe first what is going on, and then the details.
Assume there is a keyboard.kbf, and a mylayout.kbf.
In the code, everything is triggered off of an action (typically represented by a button press & the actual action is then generated by Build-A-Board). So the built-in way to change the layout is to execute the [CMD:NKBF=mylayout.kbf]. This can be put behind a button & this command (macro) placed into the Key Action in Build-A-Board. The trick is to generate this command externally. The TYPEFILE.EXE (see Tech Item PU2005120235, keystrokes longer than 30 characters) allows an external command to be triggered. The naming is unfortunate, since it can do more than just type a file. The salient point is that it can trigger a macro/command just as if the Key Action generated it. So the dance is to create a file with the [CMD:NKBF...] in it, save it as a file, then use TYPEFILE.EXE to execute from an external program - this will allow the layouts to change on the fly externally.
So here are the details. Download the TYPEFILE.EXE from our website (see link above). Place this & the mylayout.kbf in MSWIN folder of the project you are working with. Use a windowed command prompt to test, then once you have the syntax down, integrate it with your application.
- cd "\Program Files\Build-A-Board\Target\[My Project]\MSWIN[Enter]
- dir TYPEFILE.EXE
- ... TYPEFILE.EXE
- dir mylayout.kbf
- ... MYLAYOUT.KBF
Create 2 simple text files with the commands embedded in it (e.g. NOTEPAD or EDIT or COPY CON MYLAYOUT.KMF) Note I am using KMF for Keyboard Macro File, and the layout is KBF for KeyBoard File
- Here it is from the CMD prompt
>COPY CON MYLAYOUT.KMF- [CMD:NKBF=MYLAYOUT.KBF]^Z
- (Ctrl-Z or F6 key to "end" file)
- Then do it again for KEYBOARD.KBF
- COPY CON KEYBOARD.KMF
- [CMD:NKBF=KEYBOARD.KBF]^Z
- (Ctrl-Z or F6 key to "end" file)
- Now run MYTSOFT.EXE
- MYTSOFT
- Now run "typefile MYLAYOUT.KMF"
- typefile mylayout.kmf
- This will switch the layout
- typefile keyboard.kmf
- This will switch it back.
Category: Integrating(Developing) | Type: Question/Answer | Product: Build-A-Board | Version: 2.10 |
Notes:
As seen in ...