How to activate the Windows Virtual Keyboard from eXpress

This forum is for eXpress++ general support.
Message
Author
User avatar
digitsoft
Posts: 451
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

Re: How to activate the Windows Virtual Keyboard from eXpres

#31 Post by digitsoft »

Thanks Roger
Look at the changes that I made to the Touch Keyboard
Gracais for your help.
What you can do is put in blue the position that the Cursor has in the Get
The rest works for me. Great.
Attachments
Touch Keyboard.jpg
Touch Keyboard.jpg (348.18 KiB) Viewed 11462 times
Nolberto Paulino
Regards

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to activate the Windows Virtual Keyboard from eXpres

#32 Post by rdonnay »

What you can do is put in blue the position that the Cursor has in the Get
I will have to figure out how to do this.
The eXpress train is coming - and it has more cars.

User avatar
digitsoft
Posts: 451
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

Re: How to activate the Windows Virtual Keyboard from eXpres

#33 Post by digitsoft »

Yes, and use the cursors up and down
I could not do
rdonnay wrote:
What you can do is put in blue the position that the Cursor has in the Get
I will have to figure out how to do this.
Nolberto Paulino
Regards

User avatar
digitsoft
Posts: 451
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

Re: How to activate the Windows Virtual Keyboard from eXpres

#34 Post by digitsoft »

digitsoft wrote:Yes, and use the cursors up and down
I could not do
rdonnay wrote:
What you can do is put in blue the position that the Cursor has in the Get
I will have to figure out how to do this.
Attachments
Sin título.jpg
Sin título.jpg (34.45 KiB) Viewed 11459 times
Nolberto Paulino
Regards

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to activate the Windows Virtual Keyboard from eXpres

#35 Post by rdonnay »

Here is a better way to create the keyboard, using an array table to define all the buttons.

Code: Select all

nRow := 0
// Row 1
AAdd( aButtons, { nRow, 0, '!', '1',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '@','2',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '#','3',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '$','4',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '%','5',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '^','6',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '&&','7',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '*','8',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '(','9',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, ')','0',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '_','-',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '+','=',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'Del','Del',xbeK_BS, nKeySize*2, nKeySize } )
// Row 2
nRow += nKeySize + nSpace
AAdd( aButtons, { nRow, nKeySize/2, 'Q','q',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'W','w',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'E','e',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'R','r',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'T','t',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'Y','y',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'U','u',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'I','i',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'O','o',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'P','p',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '{','[',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '}',']',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '|','\',, nKeySize, nKeySize } )
// Row 3
nRow += nKeySize + nSpace
AAdd( aButtons, { nRow, nKeySize, 'A','a',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'S','s',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'D','d',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'F','f',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'G','g',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'H','h',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'J','j',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'K','k',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'L','l',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, ':',';;',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '"',"'",, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '@',"@",, nKeySize, nKeySize } )
// Row 4
nRow += nKeySize + nSpace
AAdd( aButtons, { nRow, nKeySize*1.5, 'Z','z',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'X','x',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'C','c',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'V','v',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'B','b',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'N','n',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'M','m',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '<',',',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '>','.',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '?','/',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'Enter','Enter',xbeK_ENTER, nKeySize*2, nKeySize } )
// Row 5
nRow += nKeySize + nSpace
AAdd( aButtons, { nRow, 0, 'Caps','Caps',{||::isCapsLock:=!::isCapsLock,DC_GetRefresh(GetList)}, nKeySize*2, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, ' ',' ',, nKeySize*10.6, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '.COM','.com',, nKeySize*2, nKeySize } )

FOR i := 1 TO Len(aButtons)
  @ aButtons[i,1], aButtons[i,2] DCPUSHBUTTONXP ;
     CAPTION _CaptionBlock(aButtons[i],self) ;
     SIZE aButtons[i,6], aButtons[i,7] ;
     ACTION _ActionBlock(aButtons[i],self,GetList) ;
     CONFIG ::buttonConfig
NEXT

Code: Select all

STATIC FUNCTION _CaptionBlock( aButton, self )

RETURN {||iif( ::isCapsLock,aButton[3],aButton[4])}

* ----------

STATIC FUNCTION _ActionBlock( aButton, self, GetList )

IF Empty(aButton[5])
  RETURN {||::accum(aButton[4],aButton[3],GetList)}
ELSEIF Valtype(aButton[5]) == 'B'
  RETURN aButton[5]
ENDIF
RETURN {||::accum(Chr(aButton[5]),Chr(aButton[5]),GetList)}
The eXpress train is coming - and it has more cars.

User avatar
digitsoft
Posts: 451
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

Re: How to activate the Windows Virtual Keyboard from eXpres

#36 Post by digitsoft »

hello Roger
I can use it with CAPTIONARRAY
rdonnay wrote:Here is a better way to create the keyboard, using an array table to define all the buttons.

Code: Select all

nRow := 0
// Row 1
AAdd( aButtons, { nRow, 0, '!', '1',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '@','2',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '#','3',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '$','4',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '%','5',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '^','6',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '&&','7',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '*','8',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '(','9',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, ')','0',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '_','-',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '+','=',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'Del','Del',xbeK_BS, nKeySize*2, nKeySize } )
// Row 2
nRow += nKeySize + nSpace
AAdd( aButtons, { nRow, nKeySize/2, 'Q','q',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'W','w',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'E','e',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'R','r',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'T','t',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'Y','y',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'U','u',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'I','i',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'O','o',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'P','p',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '{','[',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '}',']',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '|','\',, nKeySize, nKeySize } )
// Row 3
nRow += nKeySize + nSpace
AAdd( aButtons, { nRow, nKeySize, 'A','a',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'S','s',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'D','d',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'F','f',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'G','g',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'H','h',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'J','j',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'K','k',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'L','l',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, ':',';;',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '"',"'",, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '@',"@",, nKeySize, nKeySize } )
// Row 4
nRow += nKeySize + nSpace
AAdd( aButtons, { nRow, nKeySize*1.5, 'Z','z',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'X','x',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'C','c',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'V','v',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'B','b',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'N','n',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'M','m',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '<',',',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '>','.',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '?','/',, nKeySize, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, 'Enter','Enter',xbeK_ENTER, nKeySize*2, nKeySize } )
// Row 5
nRow += nKeySize + nSpace
AAdd( aButtons, { nRow, 0, 'Caps','Caps',{||::isCapsLock:=!::isCapsLock,DC_GetRefresh(GetList)}, nKeySize*2, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, ' ',' ',, nKeySize*10.6, nKeySize } )
AAdd( aButtons, { DCGUI_ROW, DCGUI_COL+nSpace, '.COM','.com',, nKeySize*2, nKeySize } )

FOR i := 1 TO Len(aButtons)
  @ aButtons[i,1], aButtons[i,2] DCPUSHBUTTONXP ;
     CAPTION _CaptionBlock(aButtons[i],self) ;
     SIZE aButtons[i,6], aButtons[i,7] ;
     ACTION _ActionBlock(aButtons[i],self,GetList) ;
     CONFIG ::buttonConfig
NEXT

Code: Select all

STATIC FUNCTION _CaptionBlock( aButton, self )

RETURN {||iif( ::isCapsLock,aButton[3],aButton[4])}

* ----------

STATIC FUNCTION _ActionBlock( aButton, self, GetList )

IF Empty(aButton[5])
  RETURN {||::accum(aButton[4],aButton[3],GetList)}
ELSEIF Valtype(aButton[5]) == 'B'
  RETURN aButton[5]
ENDIF
RETURN {||::accum(Chr(aButton[5]),Chr(aButton[5]),GetList)}
Nolberto Paulino
Regards

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to activate the Windows Virtual Keyboard from eXpres

#37 Post by rdonnay »

I can use it with CAPTIONARRAY
Yes
The eXpress train is coming - and it has more cars.

User avatar
digitsoft
Posts: 451
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

Re: How to activate the Windows Virtual Keyboard from eXpres

#38 Post by digitsoft »

Thanks Roger
I already solved the problem with CaptionArray
rdonnay wrote:
I can use it with CAPTIONARRAY
Yes
Nolberto Paulino
Regards

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to activate the Windows Virtual Keyboard from eXpres

#39 Post by rdonnay »

Here is how I solved the problem with showing the cursor in BLUE.

First, I create a DCSAY object in the target screen:

Code: Select all

@ 1,0 DCSAY '|' SAYSIZE 0 OBJECT ::getCursor ;
   FONT '14.Lucida Console Bold' COLOR BD_BLUE, BD_BLUE
Then I make the OSK:getCursor point to the target screen ::getCursor:

Code: Select all

DCREAD GUI FIT TITLE 'New Driver Application' ;
   MODAL TO lStatus OPTIONS GetOptions SETAPPWINDOW ;
   HANDLER ::TouchHandler REFERENCE oOsk ;
   EVAL {|o|DC_CenterObject(o,AppDeskTop()),;
            o:setPos({o:currentPos()[1],o:currentPos()[2]-30}), ;
            o:show(), ;
            oOsk:targetXbp := oGet1, ;
            oOsk:getCursor := ::getCursor, ;  <<<<<<<<<<<<<<
            SetAppFocus(oGet1)}
Then I added 3 lines of code to the Accum method of TouchKeyboard:

Code: Select all

 METHOD TouchKeyboard:Accum( cKey, cCapsKey )

LOCAL cBuffer, i, nPos

IF ::isCapsLock .AND. !Empty(cCapsKey)
  cKey := cCapsKey
ENDIF

::targetXbp:updated := .T.
FOR i := 1 TO Len(cKey)
  ::targetXbp:keyboard(Asc(cKey[i]))
NEXT

IF ::targetXbp:isDerivedFrom('DC_XbpGet')
   cBuffer := Transform ( ::targetXbp:Get:Buffer, IIf(::targetXbp:Picture==NIL, "", ::targetXbp:picture) )
   ::targetXbp:Get:_assign( )
   ::targetXbp:SetEditBuffer( cBuffer )
ENDIF

<<<<<<<<<<<<<
::getCursor:show()
::getCursor:setParent(::targetXbp)
::getCursor:setPos({((::targetXbp:get:pos-1)*16)+2,0})
>>>>>>>>>>>>>

IF Asc(cKey) == xbeK_ENTER
  SetAppFocus(::targetXbp)
  PostAppEvent(xbeP_Keyboard,xbeK_ENTER,,::targetXbp)
ENDIF

Sleep(1)

RETURN nil
You will need to calculate the positioning of ::getCursor in your DCGET object based on the font used for your gets.
The eXpress train is coming - and it has more cars.

User avatar
digitsoft
Posts: 451
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

Re: How to activate the Windows Virtual Keyboard from eXpres

#40 Post by digitsoft »

Thanks Roger
I finished making the changes to the attached Touch Keyboard, I sent him an image, already integrated into my software for tablet
Attachments
Captura.JPG
Captura.JPG (117.86 KiB) Viewed 11438 times
Nolberto Paulino
Regards

Post Reply