Ayuda en línea

Presentamos Comfort Keys Pro
Cómo comprar Comfort Keys Pro
Cómo usar Comfort Keys Pro
Configuración de Atajos de Teclado
Trabajar con el administrador de plantillas
Trabajar con el administrador del portapapeles
Uso del teclado en pantalla
Control del idioma de entrada
Personalización del tipo de teclado
Edición de plantillas
Etiquetas de texto
Edición de iconos de acceso directo
Tipos de acción
Ejecutar un programa; abrir un documento o una carpeta
Abrir uno o varios recursos de Internet
Pegar texto
Reproducir una macro de pulsaciones
Conectar/Desconectar de una red
acciones de Comfort Keys Pro
Control del audio
Control del monitor
Control de ventanas
Realizar una acción del sistema
Cambiar el idioma o mayúsculas/minúsculas
Bloquear/Reiniciar/Apagar
Tecla o atajo de bloqueo
Reemplazar tecla o atajo
Configuración
Sistema
Tema de apariencia
Atajos de teclado
Teclado en pantalla
Mostrar u ocultar
Posición
Teclas
Gestos
Acercamiento
Ayuda en la escritura
Ventana flotante
Administrador del Portapapeles
Administrador de Plantillas
Sugerencias de texto
Intercambiador de Idioma
Barra de Idioma
Íconos de Atajo
Ventana de Cambio de Tarea
Ventana de Historial de Procesos
Sonidos
Dependencias
Seguridad
Avanzado
Development
Cómo mostrar, ocultar, mover o cambiar el tamaño del teclado en pantalla
Cómo bloquear todos los ajustes
Cómo activar distintos teclados
FAQ para desarrolladores
Parámetros de línea de comandos
Otros problemas
FAQ - Preguntas frecuentes

Cómo mostrar, ocultar, mover o cambiar el tamaño del teclado en pantalla

Puede usar mensajes de Windows para manipular el teclado en pantalla.


Así:


WM_CSKEYBOARD = WM_USER + 192;

WM_CSKEYBOARDMOVE = WM_USER + 193;

WM_CSKEYBOARDRESIZE = WM_USER + 197;

 

// to show keyboard

PostMessage(FindWindow('TFirstForm', 'CKeysFirstForm'), WM_CSKEYBOARD, 1, 0);

 

// to close keyboard

PostMessage(FindWindow('TFirstForm', 'CKeysFirstForm'), WM_CSKEYBOARD, 2, 0);

 

// to fade keyboard

PostMessage(FindWindow('TFirstForm', 'CKeysFirstForm'), WM_CSKEYBOARD, 3, 0);

 

// to toggle (show/hide) keyboard

PostMessage(FindWindow('TFirstForm', 'CKeysFirstForm'), WM_CSKEYBOARD, 4, 0);

 

// to move keyboard (Left, Top - new position)

PostMessage(FindWindow('TFirstForm', 'CKeysFirstForm'), WM_CSKEYBOARDMOVE, Left, Top);


// to resize keyboard

PostMessage(FindWindow('TFirstForm', 'CKeysFirstForm'), WM_CSKEYBOARDRESIZE, Width, Height);




Private Const WM_CSKEYBOARD = WM_USER + 192

Private Const WM_CSKEYBOARDMOVE = WM_USER + 193

Private Const WM_CSKEYBOARDRESIZE = WM_USER + 197

 

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As StringAs Long

 

'Code to show keyboard

Dim hWnd As Long

hWnd = FindWindow("TFirstForm", "CKeysFirstForm")

PostMessage hWnd, WM_CSKEYBOARD, 1, 0

 

'Code to close keyboard

Dim hWnd As Long

hWnd = FindWindow("TFirstForm", "CKeysFirstForm")

PostMessage hWnd, WM_CSKEYBOARD, 2, 0

 

'Code to move keyboard

Dim hWnd As Long

hWnd = FindWindow("TFirstForm", "CKeysFirstForm")

PostMessage hWnd, WM_CSKEYBOARDMOVE, 0, 0

 

'Code to resize keyboard

Dim hWnd As Long

hWnd = FindWindow("TFirstForm", "CKeysFirstForm")

PostMessage hWnd, WM_CSKEYBOARDMOVE, Width, Height


using System;

using System.Windows.Forms;

using System.Runtime.InteropServices;

 

public const Int32 WM_USER = 1024;

public const Int32 WM_CSKEYBOARD = WM_USER + 192;

public const Int32 WM_CSKEYBOARDMOVE = WM_USER + 193;

public const Int32 WM_CSKEYBOARDRESIZE = WM_USER + 197;

 

[DllImport("user32.dll", EntryPoint = "FindWindow")]

private static extern Int32 FindWindow(string _ClassName, string _WindowName);

 

[DllImport("User32.DLL")]

public static extern Boolean PostMessage(Int32 hWnd, Int32 Msg, Int32 wParam, Int32 lParam);

 

 

Int32 hWnd = FindWindow("TFirstForm", "CKeysFirstForm");

PostMessage(hWnd, WM_CSKEYBOARD, 1, 0 ); // Show

PostMessage(hWnd, WM_CSKEYBOARD, 2, 0); // Hide

PostMessage(hWnd, WM_CSKEYBOARDMOVE, 0, 0); // Move to 0, 0

PostMessage(hWnd, WM_CSKEYBOARDRESIZE, 600, 300); // Resize to 600, 300


Const WM_CSKEYBOARD = &H400 + 192

Const WM_CSKEYBOARDMOVE = &H400 + 193

Const WM_CSKEYBOARDRESIZE = &H400 + 197

 

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As StringAs Integer 

Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As IntegerAs Integer 

 

'Open/show the Comfort On-Screen Keyboard 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 

    Dim hWnd As Integer 

    hWnd = FindWindow("TFirstForm", "CKeysFirstForm") 

    PostMessage(hWnd, WM_CSKEYBOARD, 1, 0) 

End Sub 

 

'Close the Comfort On-Screen Keyboard 

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 

    Dim hWnd As Integer 

    hWnd = FindWindow("TFirstForm", "CKeysFirstForm") 

    PostMessage(hWnd, WM_CSKEYBOARD, 2, 0) 

End Sub 

 

'Move the Comfort On-Screen Keyboard; Move it first then show it 

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click 

    Dim hWnd As Integer 

    hWnd = FindWindow("TFirstForm", "CKeysFirstForm") 

    PostMessage(hWnd, WM_CSKEYBOARDMOVE, 200, 200) 

    PostMessage(hWnd, WM_CSKEYBOARD, 1, 0) 

End Sub 

 

'Toggle the Comfort On-Screen Keyboard 

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click 

    Dim hWnd As Integer 

    hWnd = FindWindow("TFirstForm", "CKeysFirstForm") 

    PostMessage(hWnd, WM_CSKEYBOARD, 4, 0) 

End Sub 

 

'Fade the Comfort On-Screen Keyboard 

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click 

    Dim hWnd As Integer 

    hWnd = FindWindow("TFirstForm", "CKeysFirstForm") 

    PostMessage(hWnd, WM_CSKEYBOARD, 3, 0) 

End Sub 

 

'Change the keyboard type and show it 

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click 

    'Change the Registry entry for the required keyboard 

    My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\ComfortSoftware\CKeys", "KeyboardName", "Name of your chosen keyboard") 

    'Open the keyboard 

    Dim hWnd As Integer 

    hWnd = FindWindow("TFirstForm", "CKeysFirstForm") 

    PostMessage(hWnd, WM_CSKEYBOARD, 1, 0) 

End Sub 

 

'Change to another keyboard type and show it 

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click 

    'Change the Registry entry for the required keyboard 

    My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\ComfortSoftware\CKeys", "KeyboardName", "Name of another chosen keyboard") 

    'Open the keyboard 

    Dim hWnd As Integer 

    hWnd = FindWindow("TFirstForm", "CKeysFirstForm") 

    PostMessage(hWnd, WM_CSKEYBOARD, 1, 0) 

End Sub 


using namespace System::Runtime::InteropServices; 

using namespace System::Security::Permissions; 

using namespace Microsoft::Win32; 

 

const System::UInt32 WM_USER = 1024; 

const System::UInt32 WM_CSKEYBOARD = WM_USER + 192; 

const System::UInt32 WM_CSKEYBOARDMOVE = WM_USER + 193;  

 

[DllImport("user32.dll")] 

extern IntPtr FindWindow(String^ lpClassName, String^ lpWindowName); 

[DllImport("user32.dll")] 

extern IntPtr PostMessage(System::IntPtr hWnd, System::UInt32 Msg, int wParam, int lParam); 

[assembly:RegistryPermissionAttribute(SecurityAction::RequestMinimum, All = "HKEY_CURRENT_USER")]; 

 

 

....blah blah blah you normal code...

 

 

void button1_Click(System::Object^  sender, System::EventArgs^  e) 

{ 

    // Open/show the Comfort On-Screen Keyboard 

    IntPtr hWnd; 

    hWnd = FindWindow("TFirstForm", "CKeysFirstForm"); 

    PostMessage(hWnd, WM_CSKEYBOARD, 1, 0); 

} 

void button2_Click(System::Object^  sender, System::EventArgs^  e) 

{ 

        // close the Comfort On-Screen Keyboard 

    IntPtr hWnd; 

    hWnd = FindWindow("TFirstForm", "CKeysFirstForm"); 

    PostMessage(hWnd, WM_CSKEYBOARD, 2, 0); 

} 

void button3_Click(System::Object^  sender, System::EventArgs^  e) 

{ 

    //Move the Comfort On-Screen Keyboard; Move it first then show it 

    IntPtr hWnd; 

    hWnd = FindWindow("TFirstForm", "CKeysFirstForm"); 

    PostMessage(hWnd, WM_CSKEYBOARDMOVE, 200, 200); 

    PostMessage(hWnd, WM_CSKEYBOARD, 1, 0); 

} 

void button4_Click(System::Object^  sender, System::EventArgs^  e) 

{ 

    //Toggle the Comfort On-Screen Keyboard 

    IntPtr hWnd; 

    hWnd = FindWindow("TFirstForm", "CKeysFirstForm"); 

    PostMessage(hWnd, WM_CSKEYBOARD, 4, 0); 

} 

void button5_Click(System::Object^  sender, System::EventArgs^  e) 

{ 

    //Fade the Comfort On-Screen Keyboard 

    IntPtr hWnd; 

    hWnd = FindWindow("TFirstForm", "CKeysFirstForm"); 

    PostMessage(hWnd, WM_CSKEYBOARD, 3, 0); 

} 

void button6_Click(System::Object^  sender, System::EventArgs^  e) 

{ 

    //Change the keyboard type and show it 

    System::Object ^kname="NumPad"; 

 

    //Change the Registry entry for the required keyboard 

 

    RegistryKey ^key= Registry::CurrentUser->OpenSubKey ( "Software\\ComfortSoftware\\CKeys",true); 

    key->SetValue("KeyboardName",kname); 

 

    //Open the keyboard 

    IntPtr hWnd; 

    hWnd = FindWindow("TFirstForm", "CKeysFirstForm"); 

    PostMessage(hWnd, WM_CSKEYBOARD, 1, 0); 

}


/* 

 * This file is heavily based on Jawin: <a href="http://jawinproject.sourceforge.net/" rel="external">http://jawinproject.sourceforge.net/</a> 

 * 

 * assumes ComfortSoftware keyboard is loaded... 

 *  

 */ 

 

package client.keyboard; 

 

import java.io.ByteArrayInputStream; 

import java.io.IOException; 

 

import org.jawin.COMException; 

import org.jawin.FuncPtr; 

import org.jawin.ReturnFlags; 

import org.jawin.io.LittleEndianInputStream; 

import org.jawin.io.LittleEndianOutputStream; 

import org.jawin.io.NakedByteStream; 

 

public class ComfortSoftwareKeyboard { 

 

    protected static final String COMFORT_SOFTWARE_WINDOW_NAME = "CKeysFirstForm"; 

    protected static final String COMFORT_SOFTWARE_CLASS_NAME = "TFirstForm"; 

     

    protected static final int WM_USER = 1024; 

    protected static final int WM_CSKEYBOARD = WM_USER + 192; 

    protected static final int WM_CSKEYBOARDMOVE = WM_USER + 193; 

 

    protected static final Call FIND_WINDOW = new Call("USER32.DLL", "FindWindowW", "GG:I:", 8); 

    protected static final Call POST_MESSAGE = new Call("USER32.DLL", "PostMessageW", "IIII:I:", 16); 

     

    private static ComfortSoftwareKeyboard INSTANCE = new ComfortSoftwareKeyboard(); 

 

    public static ComfortSoftwareKeyboard getInstance() { 

        return INSTANCE; 

    } 

 

    protected int getWindowHandle() throws COMException, IOException { 

        FuncPtr findWindow = null; 

        findWindow = new FuncPtr(FIND_WINDOW.getDllName(), FIND_WINDOW.getFunctionName()); 

        NakedByteStream bs = new NakedByteStream(); 

        LittleEndianOutputStream leo = new LittleEndianOutputStream(bs); 

        leo.writeStringUnicode(COMFORT_SOFTWARE_CLASS_NAME); 

        leo.writeStringUnicode(COMFORT_SOFTWARE_WINDOW_NAME); 

        byte[] b = findWindow.invoke(FIND_WINDOW.getParameterDescription(), FIND_WINDOW.getStackSize(), bs, null, 

                ReturnFlags.CHECK_FALSE); 

        LittleEndianInputStream leis = new LittleEndianInputStream( 

                new ByteArrayInputStream(b)); 

        int l = leis.readInt(); 

        findWindow.close(); 

        return l; 

    } 

 

    public int move(int x, int y) throws COMException, IOException { 

        int hWnd = getWindowHandle(); 

 

        FuncPtr postMessage = null; 

        postMessage = new FuncPtr(POST_MESSAGE.getDllName(), POST_MESSAGE.getFunctionName()); 

        NakedByteStream bs = new NakedByteStream(); 

        LittleEndianOutputStream leo = new LittleEndianOutputStream(bs); 

 

        leo.writeInt(hWnd); 

        leo.writeInt(WM_CSKEYBOARDMOVE); 

        leo.writeInt(x); 

        leo.writeInt(y); 

 

        byte[] b = postMessage.invoke(POST_MESSAGE.getParameterDescription(), POST_MESSAGE.getStackSize(), bs, null, 

                ReturnFlags.CHECK_FALSE); 

        LittleEndianInputStream leis = new LittleEndianInputStream( 

                new ByteArrayInputStream(b)); 

        int l = leis.readInt(); 

        postMessage.close(); 

        return l; 

    } 

     

    public int setVisible(boolean visible) throws COMException, IOException { 

        int hWnd = getWindowHandle(); 

 

        FuncPtr postMessage = null; 

        postMessage = new FuncPtr(POST_MESSAGE.getDllName(), POST_MESSAGE.getFunctionName()); 

        NakedByteStream bs = new NakedByteStream(); 

        LittleEndianOutputStream leo = new LittleEndianOutputStream(bs); 

 

        leo.writeInt(hWnd); 

        leo.writeInt(WM_CSKEYBOARD); 

        leo.writeInt(visible ? 1 : 2); 

        leo.writeInt(0); 

 

        byte[] b = postMessage.invoke(POST_MESSAGE.getParameterDescription(), POST_MESSAGE.getStackSize(), bs, null, 

                ReturnFlags.CHECK_FALSE); 

        LittleEndianInputStream leis = new LittleEndianInputStream( 

                new ByteArrayInputStream(b)); 

        int l = leis.readInt(); 

        postMessage.close(); 

        return l; 

    } 

 

    public static void main(String[] args) throws Exception { 

        try { 

            ComfortSoftwareKeyboard keyboard = ComfortSoftwareKeyboard.getInstance(); 

            keyboard.setVisible(true); 

            Thread.sleep(1000); 

            keyboard.setVisible(false); 

            Thread.sleep(1000); 

            keyboard.setVisible(true); 

            for (int i = 0; i < 100;i++) { 

                keyboard.move(i, i); 

            } 

        } catch (COMException e) { 

        } finally { 

        } 

    } 

} 

 

class Call { 

    private int stackSize; 

    private String functionName; 

    private String parameterDescription; 

    private String dllName; 

     

    public Call(String dllName, String functionName, String parameterDescription, int stackSize) { 

        this.stackSize = stackSize; 

        this.functionName = functionName; 

        this.parameterDescription = parameterDescription; 

        this.dllName = dllName; 

    } 

    public int getStackSize() {return stackSize;} 

    public String getFunctionName() {return functionName;} 

    public String getParameterDescription() {return parameterDescription;} 

    public String getDllName() {return dllName;} 

}


Si no puede usar los mensajes de Windows, descargue y pruebe estos archivos:

https://www.comfortsoftware.com/download/ShowKB.exe

https://www.comfortsoftware.com/download/HideKB.exe

https://www.comfortsoftware.com/download/ToggleKB.exe

https://www.comfortsoftware.com/download/MoveTopKB.exe

https://www.comfortsoftware.com/download/MoveBottomKB.exe

https://www.comfortsoftware.com/download/MoveLeftKB.exe

https://www.comfortsoftware.com/download/MoveRightKB.exe

https://www.comfortsoftware.com/download/MoveKB.exe (Formato de línea de comandos: MoveKB.exe Izquierda Superior)

https://www.comfortsoftware.com/download/SetNameKB.exe (Formato de línea de comandos: SetNameKB.exe NombreDelTeclado)



Si está escribiendo software de quiosco usando HTML, puede utilizar las funciones especiales de JavaScript para controlar el teclado en pantalla.


Con JavaScript, puede mostrar, ocultar o mover el teclado. Solo tiene que usar las funciones especiales de JavaScript para añadir información relacionada con el teclado al título del navegador, y la aplicación supervisará el título para detectar cambios.


Descargue el archivo con funciones y ejemplos de JavaScript desde aquí: https://www.comfortsoftware.com/commander.html



WM_CSKEYBOARDMOVE: resolución del problema al mover el teclado cuando se usan varias pantallas con diferentes valores de PPP.


Por ejemplo, la pantalla 1 tiene una resolución de 2560x1440 y está configurada con "escala del 125%" en la configuración de pantalla de Windows. La pantalla 2 es de 1920x1080 y está configurada con "escala del 100%".


Abra la configuración de compatibilidad de aplicaciones de Windows 10 del archivo CKeys.exe y establezca el comportamiento de PPP en "Aplicación", lo que significa que la aplicación gestiona todos los cálculos relacionados con PPP. Con esta opción activada, puede pasar valores de píxeles físicos a la función de movimiento de su API, y la ventana del teclado se moverá exactamente a esa posición.


Si desea activar este modo de compatibilidad mediante programación (por ejemplo, con su propio instalador), debe establecer la siguiente clave del registro:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers:

"C:\Program Files\ComfortKeys\CKeys.exe"="~ HIGHDPIAWARE"


Esto se aplicará entonces a todos los usuarios. También puede colocar esta clave en el Registro para el usuario actual (HKCU).