myspacee Posted May 27, 2008 Share Posted May 27, 2008 hello, in your opinion is possible to build a virtual keyboard with word completation (based on dictionary text file) with Autoit ? m. Link to comment Share on other sites More sharing options...
ptrex Posted May 27, 2008 Share Posted May 27, 2008 @myspacee This is already a good start. You only have to add the dict. expandcollapse popup#include <GuiConstants.au3> Opt("GUIOnEventMode", 1) Dim $BTN_[37] Dim $NBTN_[10] Dim $x Dim $ver = "1.0.1" Dim $left = 0 Dim $top = 0 $key = StringSplit("1,2,3,4,5,6,7,8,9,0,Q,W,E,R,T,Y,U,I,O,P,A,S,D,F,G,H,J,K,L,Z,X,C,V,B,N,M", ",") $mainwindow = GUICreate("Keyboard - Enter Your PIN Number", 545, 200, 20, @DesktopHeight - 300 ) ; BUTTONS For $i = 1 To 36 $BTN_[$i] = GUICtrlCreateButton($key[$i], $left, $top, 40, 40) GUICtrlSetOnEvent($BTN_[$i], "ButtonPressed") $left = $left + 40 If $i = 10 Or $i = 20 Or $i = 29 Then $top = $top + 40 If $i = 10 Then $left = 0 If $i = 20 Then $left = 20 If $i = 29 Then $left = 40 Next $BackSpace = GUICtrlCreateButton("<-", 320, 120, 40, 40) GUICtrlSetFont(-1, 10, 500) $Input = GUICtrlCreateInput("", 40, 170, 150, 20) GUICtrlSetFont(-1, 10) $Send = GUICtrlCreateButton("&ENTER", 205, 165, 150, 30) GUICtrlSetOnEvent($BackSpace, "Back_Space") GUICtrlSetOnEvent($Send, "Send_it") GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUISetState(@SW_SHOW) GuiCreate("Pass", 142, 198, 405, 0 , BitOR($WS_CHILD, $WS_TABSTOP) + $WS_DLGFRAME, -1, $mainwindow) $Num = StringSplit("1,2,3,4,5,6,7,8,9", ",") $n = 1 $NBTN_[$n] = GuiCtrlCreateButton("1", 10, 20, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("2", 50, 20, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("3", 90, 20, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("4", 10, 60, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("5", 50, 60, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("6", 90, 60, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("7", 10, 100, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("8", 50, 100, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $n = $n + 1 $NBTN_[$n] = GuiCtrlCreateButton("9", 90, 100, 40, 40) GUICtrlSetOnEvent( -1, "Set_Num") $button_reset = GUICtrlCreateButton("Reset", 0, 0, 40, 20) GUICtrlSetOnEvent(-1,"reset") $Send2 = GuiCtrlCreateButton("Enter", 10, 140, 120, 30) GUICtrlSetOnEvent( -1, "Send_it") $Label_11 = GuiCtrlCreateLabel("Please Enter Password", 10, 170, 110, 20) $pass = 0 GuiSetState() While (1) Sleep(20) WEnd Func Show_keys() GUISetState(@SW_SHOW, $mainwindow) EndFunc;==>Show_keys Func ButtonPressed() $i = @GUI_CtrlId - $BTN_[1] + 1; array starts at item 1, so add 1 $info1 = GUICtrlRead($Input) GUICtrlSetData($Input, $info1 & $key[$i]) EndFunc;==>ButtonPressed Func Set_Num() $n = @GUI_CtrlId - $NBTN_[1] + 1; array starts at item 1, so add 1 $info1 = GUICtrlRead($Input) GUICtrlSetData($Input, $info1 & $key[$n]) EndFunc;==>ButtonPressed Func reset() GUICtrlSetData($Input,"") EndFunc Func Back_Space() $info1 = GUICtrlRead($Input) $info1 = StringTrimRight($info1, 1) GUICtrlSetData($Input, $info1) EndFunc;==>Back_Space Func CLOSEClicked() If @GUI_WinHandle = $mainwindow Then Exit EndIf EndFunc;==>CLOSEClicked Func Send_it() MsgBox(0,"", GUICtrlRead($Input)) EndFunc;==>Send_it regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now