teclado virtual. Virtual Keyboard

teclado virtual. Virtual Keyboard

Postby Arturo Lopesoria » Thu Aug 26, 2010 6:57 pm

Hola a todos.

Tengo una aplicacion en FWPPC con un teclado virtual hecho a la medida. Dentro de mi misma aplicacion funciona perfecto.

Mi pregunta es como hacer algo similar para sustituir el teclado virtual del Sistema Operativo Windows mobile y/o Windows CE. Y luego como hacer para que esta aplicacion pueda ser llamada desde otras aplicaciones cada vez que se invoque el teclado virtual.

Alguna Idea?
Arturo LS
User avatar
Arturo Lopesoria
 
Posts: 94
Joined: Fri Aug 10, 2007 1:47 am
Location: Mexico DF

Re: teclado virtual. Virtual Keyboard

Postby Antonio Linares » Tue Aug 31, 2010 8:16 am

Arturo,

El asunto no es nada simple pues implica crear un ActiveX que proporcione el nuevo teclado:

http://www.pocketpcfaq.com/wiki/tiki-index.php?mode=mobile&page=Registry%20Input

Set default SIP - Soft Input Panel - Pocket PC only

The default SIP (Soft Input Panel) on practically every device is the Keyboard. You may prefer entry with a different SIP. If so, you can set this to be the default SIP through:
HKCU\ [ControlPanel] \SIP\DefaultIM = |SIP ClassID|

The |SIP ClassID| will depend on the SIP's ClassID, which may vary per-device. You can find the correct ClassID by searching for "IsSIP [InputMethod] " in HKCR, then going to the top key and checking the name of the SIP that's in the (Default) value.

Please note that this doesn't work with all SIPs. Transcriber/Calligrapher are two examples of this.
You can, however, set Transcriber as the default SIP by starting Transcriber.exe on startup. (This should be moved to, or added to, non-registry Tweaks page)

WARNING : Do not assume that the below ClassIDs would be -as found- on your device! Setting it to a non-existant SIP may prevent your device from booting up!
WARNING : If you set an invalid value in DefaultIM (or apparently if you're running a recent AKU [http://forum.xda-developers.com/showpost.php?p=1032402&postcount=800] ), then you'll probably have to hard reset your device.

Note : An alternative means of changing the default SIP is by using the SIPChange utility: [http://forum.xda-developers.com/showpost.php?p=995883&postcount=16]
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41205
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: teclado virtual. Virtual Keyboard

Postby Arturo Lopesoria » Tue Aug 31, 2010 2:27 pm

Gracias Antonio, por la introduccioon y la liga.

Efectivamente, se ve algo complicado, y ademas un tanto riesgozo.

Si encuentro resultados te los reportare aqui en el foro.

Saludos!
Arturo LS
User avatar
Arturo Lopesoria
 
Posts: 94
Joined: Fri Aug 10, 2007 1:47 am
Location: Mexico DF

Re: teclado virtual. Virtual Keyboard

Postby PeterBaga » Mon Sep 06, 2010 9:00 am

Bom dia Arturo.

Nos poderias postear uno piqueno exemplo de como chamar um teclado virtual por medida.


Gracias.
Pedro
User avatar
PeterBaga
 
Posts: 52
Joined: Sun Jan 24, 2010 3:39 pm

Re: teclado virtual. Virtual Keyboard

Postby Arturo Lopesoria » Wed Sep 08, 2010 5:05 am

Peter:

Lo que tengo En realidad NO es un teclado Virtual.
Unicamente lo que hago es llamar desde un evento de objeto GET un Dialog con botones de teclado, y el resultado lo mando de regreso al GET.
Pero esto, obviamente, no puede ser usado mas que DENTRO de mi aplicacion.

Aun asi, por si a alguien le sirve el ejemplo:

Code: Select all  Expand view

function Main()

   local oWnd, oFont
   
   
   DEFINE WINDOW oWnd TITLE "Llamar mi dialog de teclado"
   
   @ 08, 2 BUTTON "&TestGet"    SIZE 60, 30 ACTION TestGet()
   @ 12, 2 BUTTON "&End"        SIZE 60, 30 ACTION oWnd:End()

   ACTIVATE WINDOW oWnd
   
return nil



*****************************************************************************

Function TestGet()
   local oDlg, oGet1, cName1 := space(10)

           
DEFINE DIALOG oDlg RESOURCE "TESTGET" // STYLE WS_OVERLAPPED

     REDEFINE GET oGet1 var cName1   ID 26 OF oDLG
            oGet1:bKeyChar = { | nKey | MyKeyPad( nKey, @oGet1, @cName1 ) }
           
ACTIVATE DIALOG oDlg CENTERED
     
return nil
*****************************************************************************



Function MyKeyPad( nKey, oGet, cCapture )
local  aOx:=array(44)

// Antes de entrar puedes evaluar el valor de nKey

       
private cResp:="", oChk1, lPlantilla:=.t.,;
        cPlantilla:="99AAAA9999", cFlag

DEFINE DIALOG oDlg RESOURCE "KeypadC" // STYLE WS_OVERLAPPED
       // set font of oDlg to oFont

     REDEFINE BUTTON aOx[01] ID 101 OF oDlg action KP("A", @aOx, @cCapture)
     REDEFINE BUTTON aOx[02] ID 102 OF oDlg action KP("B", @aOx, @cCapture)
     REDEFINE BUTTON aOx[03] ID 103 OF oDlg action KP("C", @aOx, @cCapture)
     REDEFINE BUTTON aOx[04] ID 104 OF oDlg action KP("D", @aOx, @cCapture)
     REDEFINE BUTTON aOx[05] ID 105 OF oDlg action KP("E", @aOx, @cCapture)
     REDEFINE BUTTON aOx[06] ID 106 OF oDlg action KP("F", @aOx, @cCapture)
     REDEFINE BUTTON aOx[07] ID 107 OF oDlg action KP("G", @aOx, @cCapture)
     REDEFINE BUTTON aOx[08] ID 108 OF oDlg action KP("H", @aOx, @cCapture)
     REDEFINE BUTTON aOx[09] ID 109 OF oDlg action KP("I", @aOx, @cCapture)
     REDEFINE BUTTON aOx[10] ID 110 OF oDlg action KP("J", @aOx, @cCapture)
     REDEFINE BUTTON aOx[11] ID 111 OF oDlg action KP("K", @aOx, @cCapture)
     REDEFINE BUTTON aOx[12] ID 112 OF oDlg action KP("L", @aOx, @cCapture)
     REDEFINE BUTTON aOx[13] ID 113 OF oDlg action KP("M", @aOx, @cCapture)
     REDEFINE BUTTON aOx[14] ID 114 OF oDlg action KP("N", @aOx, @cCapture)
     REDEFINE BUTTON aOx[15] ID 115 OF oDlg action KP("Ñ", @aOx, @cCapture)
     REDEFINE BUTTON aOx[16] ID 116 OF oDlg action KP("0", @aOx, @cCapture)
     REDEFINE BUTTON aOx[17] ID 117 OF oDlg action KP("P", @aOx, @cCapture)
     REDEFINE BUTTON aOx[18] ID 118 OF oDlg action KP("Q", @aOx, @cCapture)
     REDEFINE BUTTON aOx[19] ID 119 OF oDlg action KP("R", @aOx, @cCapture)
     REDEFINE BUTTON aOx[20] ID 120 OF oDlg action KP("S", @aOx, @cCapture)
     REDEFINE BUTTON aOx[21] ID 121 OF oDlg action KP("T", @aOx, @cCapture)
     REDEFINE BUTTON aOx[22] ID 122 OF oDlg action KP("U", @aOx, @cCapture)
     REDEFINE BUTTON aOx[23] ID 123 OF oDlg action KP("V", @aOx, @cCapture)
     REDEFINE BUTTON aOx[24] ID 124 OF oDlg action KP("W", @aOx, @cCapture)
     REDEFINE BUTTON aOx[25] ID 125 OF oDlg action KP("X", @aOx, @cCapture)
     REDEFINE BUTTON aOx[26] ID 126 OF oDlg action KP("Y", @aOx, @cCapture)
     REDEFINE BUTTON aOx[27] ID 127 OF oDlg action KP("Z", @aOx, @cCapture)
                                       
     REDEFINE BUTTON aOx[30] ID 130 OF oDlg action KP("0", @aOx, @cCapture)
     REDEFINE BUTTON aOx[31] ID 131 OF oDlg action KP("1", @aOx, @cCapture)
     REDEFINE BUTTON aOx[32] ID 132 OF oDlg action KP("2", @aOx, @cCapture)
     REDEFINE BUTTON aOx[33] ID 133 OF oDlg action KP("3", @aOx, @cCapture)
     REDEFINE BUTTON aOx[34] ID 134 OF oDlg action KP("4", @aOx, @cCapture)
     REDEFINE BUTTON aOx[35] ID 135 OF oDlg action KP("5", @aOx, @cCapture)
     REDEFINE BUTTON aOx[36] ID 136 OF oDlg action KP("6", @aOx, @cCapture)
     REDEFINE BUTTON aOx[37] ID 137 OF oDlg action KP("7", @aOx, @cCapture)
     REDEFINE BUTTON aOx[38] ID 138 OF oDlg action KP("8", @aOx, @cCapture)
     REDEFINE BUTTON aOx[39] ID 139 OF oDlg action KP("9", @aOx, @cCapture)
                                       
     REDEFINE BUTTON aOx[29] ID 129 OF oDLG action KPCtrl("Back" , @aOx, @cCapture)
     REDEFINE BUTTON aOx[40] ID 140 OF oDLG action KPCtrl("NUM"  , @aOx, @cCapture)
     REDEFINE BUTTON aOx[41] ID 141 OF oDLG action KPCtrl("CHRS", @aOx, @cCapture)
     REDEFINE BUTTON aOx[42] ID 142 OF oDLG action KPCtrl("Enter", @aOx, @cCapture)
     REDEFINE BUTTON aOx[44] ID 144 OF oDLG action KPCtrl("Space", @aOx, @cCapture)
                         
     REDEFINE GET aOx[28] var cCapture   ID 128 OF oDLG when .f.
     
     REDEFINE CHECKBOX ochk1 VAR lPlantilla ID 145 of oDlg
 
ACTIVATE DIALOG oDlg CENTERED ;
             ON INIT ( KeyPadToNum( @aOx ) )
   
    oGet:refresh()

RETURN .t.
*****************************************************************************

function KP(cText, aOx, cCapture)
    if len(cCapture)<40
        cCapture+=cText
        aOx[28]:Refresh()
        if lPlantilla
            ChkPlantilla(@aOx, @cCapture)
        endif
    endif
return .t.
*****************************************************************************

function KPCtrl(cText, aOx, cCapture)
    cText:=upper(cText)
    do case
        case "BACK"$cText
            if len(cCApture)>0
                cCapture := subs( cCapture, 1, len(cCapture)-1 )
                aOx[28]:Refresh()
            endif
        case "SPACE"$cText
            if len(cCapture)<40
                cCapture += " "
                aOx[28]:Refresh()
            endif
        case "NUM"$cText
            KeyPadToNum(@aOx)
        case "CHRS"$cText
            KeyPadToChr(@aOx)
        case "ENTER"$cText
    endcase
    if lPlantilla
        ChkPlantilla(@aOx, @cCapture)
    endif
return .t.
*****************************************************************************

Function KeyPadToNum(aOx)
for i:=1 to 27
    aOx[i]:Hide()
next
for i:=30 to 39
    aOx[i]:Show()
next
aOx[40]:Hide()  // ESCONDE BOTON NUM
aOx[41]:Show()  //SHOW BTN CHRS
cFlag:="9"
return .t.
*****************************************************************************

Function KeyPadToChr(aOx)
for i:=30 to 39
    aOx[i]:Hide()
next
for i:=1 to 27
    aOx[i]:Show()
next
aOx[41]:Hide()
aOx[40]:Show()
cFlag:="A"
return .t.
*****************************************************************************

Function ChkPlantilla(aOx, cCapture)
    if cFlag <> SUBS(cPlantilla, len(cCapture)+1, 1 )
        if cFlag="A"
            KeyPadToNum(@aOx)
        else
            KeyPadToChr(@aOx)
        endif
    endif
return .t.
*****************************************************************************


 


Saludos.
Arturo LS
User avatar
Arturo Lopesoria
 
Posts: 94
Joined: Fri Aug 10, 2007 1:47 am
Location: Mexico DF

Re: teclado virtual. Virtual Keyboard

Postby PeterBaga » Thu Sep 09, 2010 2:27 pm

Muchas Gracias por atencion.
Vou testar...
Saludos.
Pedro Alexandre C. Bagarrão
User avatar
PeterBaga
 
Posts: 52
Joined: Sun Jan 24, 2010 3:39 pm

Re: teclado virtual. Virtual Keyboard

Postby PeterBaga » Thu Sep 09, 2010 3:32 pm

Arturo.

Poderias disponibilizar el ficheiro RC??

Muchas Gracias..
Pedro Alexandre C. Bagarrão
User avatar
PeterBaga
 
Posts: 52
Joined: Sun Jan 24, 2010 3:39 pm

Re: teclado virtual. Virtual Keyboard

Postby Arturo Lopesoria » Thu Sep 09, 2010 4:15 pm

Si, con gusto.
Espero que te haya servido de algo
Como se puede ver esta pantalla esta colgada al evento bKeyChar() del objeto GET.
Aunque la mejor manera debiera ser colgarla al evento LButtonDown(),
Habria que preguntar a Antonio porque este evento no esta disponible,
En mi caso tuve que hacer una derivacion de la clase GET,
para lo cual copie y modifique el programa TGet.prg para tener disponible LButtonDown().

Aqui anexo el archivo del RC para el ejemplo

NOTA: para tus pruebas te recomiendo eliminar lo referente a checkbox "Codigo", esto se puso par aceptar un patron de captura, donde el programa automaticamente va cambiando de modalidad Alfabetica a Numerica.

Code: Select all  Expand view

#ifdef _CE
   #include "c:\vce\include\arm\windows.h"
   #include "c:\vce\include\arm\commctrl.h"
#endif



TESTGET DIALOG DISCARDABLE 10, 7, 138, 168
STYLE WS_POPUP|DS_MODALFRAME|WS_SYSMENU|WS_VISIBLE
FONT 8, "System"
{
  CONTROL "", 26, "Edit", WS_BORDER|WS_TABSTOP, 5, 10, 91, 12
}


KEYPADC DIALOG DISCARDABLE 10, 7, 138, 168
STYLE WS_POPUP|DS_MODALFRAME|WS_SYSMENU|WS_VISIBLE
FONT 8, "System"
{
  CONTROL "A", 101, "Button", WS_TABSTOP, 3, 29, 20, 16
  CONTROL "B", 102, "Button", WS_TABSTOP, 25, 29, 20, 16
  CONTROL "C", 103, "Button", WS_TABSTOP, 47, 29, 20, 16
  CONTROL "D", 104, "Button", WS_TABSTOP, 70, 29, 20, 16
  CONTROL "E", 105, "Button", WS_TABSTOP, 92, 29, 20, 16
  CONTROL "F", 106, "Button", WS_TABSTOP, 114, 29, 20, 16
  CONTROL "G", 107, "Button", WS_TABSTOP, 3, 53, 20, 16
  CONTROL "H", 108, "Button", WS_TABSTOP, 25, 53, 20, 16
  CONTROL "I", 109, "Button", WS_TABSTOP, 47, 53, 20, 16
  CONTROL "J", 110, "Button", WS_TABSTOP, 70, 53, 20, 16
  CONTROL "K", 111, "Button", WS_TABSTOP, 92, 53, 20, 16
  CONTROL "L", 112, "Button", WS_TABSTOP, 114, 53, 20, 16
  CONTROL "M", 113, "Button", WS_TABSTOP, 3, 77, 20, 16
  CONTROL "N", 114, "Button", WS_TABSTOP, 25, 77, 20, 16
  CONTROL "O", 116, "Button", WS_TABSTOP, 47, 77, 20, 16
  CONTROL "P", 117, "Button", WS_TABSTOP, 70, 77, 20, 16
  CONTROL "Q", 118, "Button", WS_TABSTOP, 92, 77, 20, 16
  CONTROL "R", 119, "Button", WS_TABSTOP, 114, 77, 20, 16
  CONTROL "S", 120, "Button", WS_TABSTOP, 3, 101, 20, 16
  CONTROL "T", 121, "Button", WS_TABSTOP, 25, 101, 20, 16
  CONTROL "U", 122, "Button", WS_TABSTOP, 47, 101, 20, 16
  CONTROL "V", 123, "Button", WS_TABSTOP, 70, 101, 20, 16
  CONTROL "W", 124, "Button", WS_TABSTOP, 92, 101, 20, 16
  CONTROL "X", 125, "Button", WS_TABSTOP, 114, 101, 20, 16
  CONTROL "Y", 126, "Button", WS_TABSTOP, 70, 125, 20, 16
  CONTROL "Z", 127, "Button", WS_TABSTOP, 92, 125, 20, 16
  CONTROL "Ñ", 115, "Button", WS_TABSTOP, 114, 125, 20, 16
  CONTROL "NUM", 140, "Button", WS_TABSTOP, 7, 148, 36, 16
  CONTROL "CHRS", 141, "Button", WS_TABSTOP, 7, 148, 36, 16
  CONTROL "Espacio", 144, "Button", WS_TABSTOP, 6, 126, 56, 16
  CONTROL "<<ENTER>>", 142, "Button", WS_TABSTOP, 90, 149, 44, 16
  CONTROL "1", 131, "Button", WS_TABSTOP, 3, 28, 41, 16
  CONTROL "2", 132, "Button", WS_TABSTOP, 48, 28, 41, 16
  CONTROL "3", 133, "Button", WS_TABSTOP, 94, 28, 41, 16
  CONTROL "4", 134, "Button", WS_TABSTOP, 3, 52, 41, 16
  CONTROL "5", 135, "Button", WS_TABSTOP, 48, 52, 41, 16
  CONTROL "6", 136, "Button", WS_TABSTOP, 94, 52, 41, 16
  CONTROL "7", 137, "Button", WS_TABSTOP, 3, 76, 41, 16
  CONTROL "8", 138, "Button", WS_TABSTOP, 48, 76, 41, 16
  CONTROL "9", 139, "Button", WS_TABSTOP, 94, 76, 41, 16
  CONTROL "0", 130, "Button", WS_TABSTOP, 48, 100, 41, 16
  CONTROL "", 128, "Edit", WS_BORDER|WS_TABSTOP, 5, 10, 91, 12
  CONTROL "<--", 129, "Button", WS_TABSTOP, 109, 10, 24, 14
  CONTROL "Codigo", 145, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 51, 151, 32, 12
}


 


Saludos
Arturo
Arturo LS
User avatar
Arturo Lopesoria
 
Posts: 94
Joined: Fri Aug 10, 2007 1:47 am
Location: Mexico DF

Re: teclado virtual. Virtual Keyboard

Postby PeterBaga » Sat Sep 11, 2010 9:38 am

Arturo.

Muchas Gracias por tu feed Back.
Hay sido muy interesante analisar tu teclado virtual.

Otro assunto que mi gostaria colocar neste forum es relacionado con el aspecto de los butones.
Hay alguna forma de dar un aspecto mas moderno a los botones??
Hay alguno manifest file o algo do genero para dar uno aspecto mas profisional a los botones??

Muchas Gracias por tus respuestas...
Un gran saludo...
Pedro
Pedro Alexandre C. Bagarrão
User avatar
PeterBaga
 
Posts: 52
Joined: Sun Jan 24, 2010 3:39 pm

Re: teclado virtual. Virtual Keyboard

Postby Arturo Lopesoria » Sat Sep 11, 2010 2:25 pm

Como te decia al inicio, este NO ES un teclado virtual como tal, pero sigo investigando acerca de ello.

Respecto al aspecto, te recomiendo busques Alphablend en este foro, y tambien sobre el trabajo de Silvio, tambien puedes abrir otro topic para conocer que es lo ultimo que otros usuarios han hecho.

Saludos.
Arturo LS
User avatar
Arturo Lopesoria
 
Posts: 94
Joined: Fri Aug 10, 2007 1:47 am
Location: Mexico DF

Re: teclado virtual. Virtual Keyboard

Postby Simon » Sat Oct 23, 2010 1:26 am

Hola arturo estoy usando tu teclado con unas modificaciones, ya que solo necesito el teclado numerico, backspace y enter.

Ahora mi problema es el siguiente necesito lanzar el teclado una vez el get tome el foco, no puedo usar :bgotfocus, porque me queda un bucle infinito, tu función lanza el teclado al darle enter.

me puedes dar una mano.

Gracias y saludos.
Simon
 
Posts: 105
Joined: Thu Oct 20, 2005 12:29 pm
Location: Maracaibo, Venezuela.


Return to FiveWin para Pocket PC

Who is online

Users browsing this forum: No registered users and 6 guests