Jump to content
Sign in to follow this  
Myicq

How to open on-screen-keyboard

Recommended Posts

All,

I have developed a good app for touch screen controllers. But I would like to save myself the time to develop an on-screen-keyboard. The touch controller does come with the built-in-Windows keyboard, but I think it's too bulky and can't be resized.

I have tried the free keyboard "Click-N-Type", which is now a little outdated. I can open the keyboard, move it as desired and close it again.

Problem is when I type something! I would like to open the keyboard just below the inputbox automatically. However when I type first character, I get focus on my form, and my form will cover the keyboard.

Maybe I am missing something here.. is there any example code on how to work in code with on-screen-keyboards ? (other thank kdb.exe from Microsoft).

This is what I have so far:

; 
; using keyboard from
; http://cnt.lakefolks.com/
;

$kdb = 'c:\keyboard\Click-N-Type.exe '

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 615, 438, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 80, 104, 177, 81)
$Button2 = GUICtrlCreateButton("Button2", 296, 112, 185, 89)
$i = GUICtrlCreateInput("TEST", 80, 200,400,40)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        case $Button1
            _movekbd()

        Case $Button2
            _startkbd()

    EndSwitch
WEnd

Func _movekbd()
    if ProcessExists("Click-N-Type.exe") then
        WinMove("Click-N-Type", "", Random(0,@DesktopWidth,1), Random(0,@DesktopHeight,1))
        WinSetOnTop("Click-N-Type", "", 1)
;~      GUICtrlSetState($i, $GUI_FOCUS)

    Else
        run($kdb, "c:\keyboard\", @SW_SHOW)
        WinSetOnTop("Click-N-Type", "", 1)
    EndIf
EndFunc


Func _startkbd()
        ; Display a list of Notepad processes returned by ProcessList.
    Local $aProcessList = ProcessList("Click-N-Type.exe")
    For $i = 1 To $aProcessList[0][0]
        ProcessClose($aProcessList[$i][1])
    Next
    Sleep(100)
EndFunc

Any kind of help appreciated.

 


I am just a hobby programmer, and nothing great to publish right now.

Share this post


Link to post
Share on other sites

Try osk.exe

Yes, I realize that is an option I can always use :) But since that specific keyboard offers very little styling and configuration options I am looking at other options before.

Btw, there is also "tabtip.exe" available on Windows. That too can't really be styled.

Maybe my fav OSK is just too old for a Win7 machine these days..  so, so far out look for other alternatives.

 


I am just a hobby programmer, and nothing great to publish right now.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • By Ronster
      I would like to create an auto login program using mouseclicks, controlclicks only, or whatever is required to send characters from Windows 10 On-Screen Keyboard to a User/Password login form. I thought I would start with OSK to NotePad. Using mouseclicks to enter ID/Password seems more secure than typing plain text. Seems like if I can get that to work I should be able to send the characters to any login form. I have tried many things but cannot send a character(s) from OSK to Notepad. Of course manually works great. Here is some code I have tried:
      ControlGetFocus ("Untitled - Notepad")
          ; go to Notepad window
          MouseMove(649, 206 , 0)  ;move to Notepad, then click below
          Sleep (1000)
          MouseClick($MOUSE_CLICK_LEFT,"left")
          ControlGetFocus ("On-Screen Keyboard")
          ; go to OSK window then click on a character key
          MouseMove(642, 807 , 0) ;letter - t
          Sleep (1000)
          MouseClick($MOUSE_CLICK_LEFT,"left")
      OR
      ControlClick("On-Screen Keyboard","","[CLASS:OSKMainClass]","left","",642, 807)
      The above move to the correct position and appear to click but focus is lost to Notepad. Any help would be appreciated.
×
×
  • Create New...