programmable virtual keyboard development

Cecil

19+ years progress programming and still learning.
HELLO and for the control key ???

Can you give me some example multi-key combinations you would like to use?

I *might* changing the code to utilise .NET sendkeys functions but that would require a change to the WAIT-FOR of your main allocation.
 

Cecil

19+ years progress programming and still learning.
I've made some redesigns to help make things simpler and that was to use .NET rather than using Windows API directly. It's now easier to edit the XML files as well.

The new code is located here:
GitHub - Jimbobnz/ABL-Virtual-Keyboard-.NET: ABL Virtual Keyboard using .NET

Changes need for this to work correctly. In the main block of your application you will need to change the WAIT-FOR statement:

Code:
  IF NOT THIS-PROCEDURE:PERSISTENT THEN .
/*     WAIT-FOR CLOSE OF THIS-PROCEDURE. */
    WAIT-FOR System.Windows.Forms.Application:Run().


The XML code has changed to include some extra attributes for CTRL and ALT keys so you can do multi-key presses .i.e CTRL+SHIFT+ALT+F2

The key-value attribute has changed from using a numerical value to a character literal value. i.e. 'A' is not the same as 'a'.


Known problems:
  1. CTRL+A (Select ALL) does not seem to work, but COPY and PASTE does. I think OPENEDGE CTRL+A is translated as APPEND-LINE.
  2. THE left & right navigation keys don't seem to behave correctly on decimal fields.

TODO:
  1. Somehow dynamically detect widget has the current focus and test to see if it's a decimal datatype. If the condition is true, then override the default LEFT & RIGHT keypresses with ABL APPLY CURSOR-LEFT or APPLY CURSOR-RIGHT statements.



Code:
  <keyboard key-label="PASTE" shift-key="false" ctrl-key="true" alt-key="false" key-value="v" layer="1" row="5" pos="3">
    <width>61</width>
    <height>28</height>
    <indent>0</indent>
    <sensitive>true</sensitive>
    <image-up/>
    <image-dwn/>
  </keyboard>


USE THE .NET SPECIAL KET CODES:

  1. BACKSPACE {BACKSPACE}, {BS}, or {BKSP}
  2. BREAK {BREAK}
  3. CAPS LOCK {CAPSLOCK}
  4. DEL or DELETE {DELETE} or {DEL}
  5. DOWN ARROW {DOWN}
  6. END {END}
  7. ENTER {ENTER}
  8. HELP {HELP}
  9. HOME {HOME}
  10. INS or INSERT {INSERT} or {INS}
  11. LEFT ARROW {LEFT}
  12. NUM LOCK {NUMLOCK}
  13. PAGE DOWN {PGDN}
  14. PAGE UP {PGUP}
  15. PRINT SCREEN {PRTSC} (reserved for future use)
  16. RIGHT ARROW {RIGHT}
  17. SCROLL LOCK {SCROLLLOCK}
  18. TAB {TAB}
  19. UP ARROW {UP}
  20. F1 {F1}
  21. F2 {F2}
  22. F3 {F3}
  23. F4 {F4}
  24. F5 {F5}
  25. F6 {F6}
  26. F7 {F7}
  27. F8 {F8}
  28. F9 {F9}
  29. F10 {F10}
  30. F11 {F11}
  31. F12 {F12}
  32. F13 {F13}
  33. F14 {F14}
  34. F15 {F15}
  35. F16 {F16}
  36. Keypad add {ADD}
  37. Keypad subtract {SUBTRACT}
  38. Keypad multiply {MULTIPLY}
  39. Keypad divide {DIVIDE}
 
Last edited:

borhane

Member
hello Cecil thank you for your help I did all the combination and I finished the virtual keyboard.
Question is what I can color the buttons.
if i can color how can i add it ??
 

Cecil

19+ years progress programming and still learning.
hello Cecil thank you for your help I did all the combination and I finished the virtual keyboard.
Question is what I can color the buttons.
if i can color how can i add it ??
I will need make some addition code changes for the colour.

I’m tied up for the next few days so I can’t help you out.

But in the mean time, out of curiosity I would love to see what you have achieved using the virtual keyboard. Send us your screen shots.
 

Cecil

19+ years progress programming and still learning.
1516913213197.png

Unfortunately, it's not possible to change the background colour of a button. "Button colour not supported under MS-WINXP", it should say Windows and not MS-WINXP.
I think this is why I was going to add the ability to use images instead (Still not implemented).
If you do try and set the foreground and background colour it looks a bit like this.

1516913451484.png


However, I thought it is possible the set the button colour using Win32 API calls. Need to investigate.

REF:
Progress KB - Button color: Why does Windows ignore color changes?
 

Cecil

19+ years progress programming and still learning.
Make changes to the source code that tries to change the BGCOLOR attribute. Currently defaults to 12 which red in my ABL colour pallet.

1516914618901.png
 

Cecil

19+ years progress programming and still learning.
This is a proof of concept of using images for the background of buttons. The downside is that it's a lot more work.
I just google for downloadable images of keyboard buttons

1516915383504.png
 

Cecil

19+ years progress programming and still learning.
I believe it says "Starting a second message loop on a single thread is not a valid operation. Use Form.ShowDialog instead".
Google search


I've seen this error before. I think it's something to do with WAIT-FOR and .NET

Have you got WAIT-FOR System.Windows.Forms.Application:Run () . in your main application?
 

borhane

Member
I do not understand anything ???
I put in place of the WAIT-FOR System.Windows.Forms.Application: Run ().
to exit windows open.
 

borhane

Member
Hello everyone ;
thank you sir for kindly help me out of second .net session that still remains open ???? see previous message.
 
Top