programmable virtual keyboard development

#21
Code:
on choose of btn1 in frame default-frame
do:
  assign iVar = 1.
  /*do additional stuff if you need to*/
end.
Afterward you can work with that value in the variable.
Seriously, I don't get your problem, sir.
 
#23
on choose of button-1:
do:
/* Assuming you want to update a fill-in named Fill-In-1 */
assign Fill-in-1:screen-value = fill-in-1:screen-value + "1".
end.
 

Cecil

17+ years progress programming and still learning.
#24
Code for button event to insert a string value into the editor box.

1513126447624.png

Code in Action.
1513126482776.png

Code to 'Backspace/Delete' the last character.
1513126529804.png
 
#25
thank you Cecil I found the solution to insert a figure under a fill-in but it is necessary to test the code with my program of the box because it is a delicate one to apply it in the fill-in of the seizure.
 

Cecil

17+ years progress programming and still learning.
#26
thank you Cecil I found the solution to insert a figure under a fill-in but it is necessary to test the code with my program of the box because it is a delicate one to apply it in the fill-in of the seizure.
This is where you use handles of the fill-in & editors and dynamically populate the fill-in. I'll try and create a demo program tomorrow.
 

Fabio

New Member
#28
Hello friend,

I did this sample for you, try it and let me know.

Unzip the file, run w-cashing.w and after, click on "Open Keyboard" button.

Feel free to change anything you think needs doing.
 

Attachments

Cecil

17+ years progress programming and still learning.
#29
I having a some problems with the decimal fields and emulating the BACKSPACE key at the moment.
 

Fabio

New Member
#30
With decimals and integer fields will be a big problem. I think the only solution is to use SendInput or SendMessage, from Win32 api, to simulate the keystrokes.
 

Fabio

New Member
#31
Hello,

I did another approach, more efficient, using keybd_event from Win32 API.

You can customize the virtual keyboard with any keystrokes that you need.

Try it and let me know.
 

Attachments

Cecil

17+ years progress programming and still learning.
#32
Hello,

I did another approach, more efficient, using keybd_event from Win32 API.

You can customize the virtual keyboard with any keystrokes that you need.

Try it and let me know.
That works quite well. Now we just needed to figure out if the CAPS-LOCK in 'on' or 'off'.

Also, the ABL is able to handle HEX values, not just integers.

Code:
&SCOPED-DEFINE VK_BACK         0x08
&SCOPED-DEFINE VK_0           0x60
&SCOPED-DEFINE VK_1           0x61
&SCOPED-DEFINE VK_2           0x62
&SCOPED-DEFINE VK_3           0x63
&SCOPED-DEFINE VK_4           0x64
&SCOPED-DEFINE VK_5           0x65
&SCOPED-DEFINE VK_6           0x66
&SCOPED-DEFINE VK_7           0x67
&SCOPED-DEFINE VK_8           0x68
&SCOPED-DEFINE VK_9           0x69
&SCOPED-DEFINE VK_OEM_COMMA  188
&SCOPED-DEFINE VK_OEM_PERIOD 190

&SCOPED-DEFINE VK_OEM_PERIOD 0x14

Also, for the decimal fill-ins, you might need to set the cursor/caret position so the number pad starts working. Normally you would use the 'CURSOR-OFFSET' attribute, but that only applies to character data-types? If the operator tabs into the decimal field it's Okay. but if the user clicks into the field that's when caret position needs to be specified.

Code:
ON ENTRY OF fi-decimal IN FRAME frm-data-types /* Decimal */
DO:
 
    Def var pos as integer no-undo.
    pos = index( SELF:SCREEN-VALUE,'.').
    self:SET-SELECTION( pos, pos).
END.
 

Fabio

New Member
#34
Hi,

Thank you for your notes. I really didn't know about HEX values in ABL.

I saw this KB too. I'll implement and post again.
 

Cecil

17+ years progress programming and still learning.
#35
Just develop a dynamic virtual keyboard where each keyboard key is dynamically created from an XML file. I'm basing it upon the Microsoft Touch Keyboard. I took me a bit of time to understand the querks of Shift kKeys and multiple key combinations.

1513384781865.png
1513385022448.png
 
#37
thank you for your help I am in the process of programming a virtual keyboard cashier but I have a problem key combination keyboard for example: "shift + f1" on xml
 

Cecil

17+ years progress programming and still learning.
#38
ABL way is to:

Code:
APPLY "SHIFT-F1" TO widget-handle.
Utilising WinAPI method:


Code:
        &SCOPED-DEFINE KEYSHIFT 0x10
        &SCOPED-DEFINE KEYF1 0x70
        &SCOPED-DEFINE KEYPRESDOWN 0x01
        &SCOPED-DEFINE KEYPRESUP 0x02
        
        DEFINE VARIABLE retCode AS INTEGER     NO-UNDO.
        
            
        
        RUN keybd_event ({&KEYSHIFT}, 0, 0, 0, OUTPUT retCode).       
        RUN keybd_event ({&KEYF1}, 0, 0, 0, OUTPUT retCode).
        RUN keybd_event ({&KEYF1}, 0, {&KEYPRESUP}, 0, OUTPUT retCode).
        RUN keybd_event ({&KEYSHIFT}, 0, {&KEYPRESUP}, 0, OUTPUT retCode).
 

Cecil

17+ years progress programming and still learning.
#40
excuse me Cecil I did not understand how I can put a combination in a button "Shift + F1" ?????
abl + xml ???
Arr, so you are using the 'ABL Virtual Keyboard'. Alter the 'layer', 'row' and 'pos' attributes.

Code:
  <keyboard key-label="SHIFT+F1" shift-key="true" key-value="112" layer="1" row="1" pos="1">
    <width>61</width>
    <height>58</height>
    <indent>0</indent>
    <image-up/>
    <image-dwn/>
  </keyboard>
The key-value="112", 112 is the decimal representation of the HEX value of 0x70. 0x70 is the F1 key.

Notice how the shift-key="true" is set to true.

The image-up & image-dwn elements are not yet implemented. The idea that the button will show an image rather than the text.

REF:
Virtual-Key Codes
 
Last edited:
Top