HI
Kennt jemande die HEX Codes für IfPressed für Umlaute ?
A-z (ASCII) geht
Gruß
Wolke
HI
Kennt jemande die HEX Codes für IfPressed für Umlaute ?
A-z (ASCII) geht
Gruß
Wolke
Hi,
[autoit]$dll = DllOpen("user32.dll")
While _IsPressedMod($dll); clear buffer
WEnd
While 1
Sleep(250)
$typed = _IsPressedMod($dll)
If $typed Then ExitLoop
WEnd
DllClose($dll)
MsgBox(0,'',$typed & @LF)
[/autoit][autoit][/autoit][autoit]; http://msdn.microsoft.com/library/default....ualKeyCodes.asp
Func _IsPressedMod($dll = "user32.dll")
Local $aR, $bRv, $hexKey, $i
For $i = 1 To 256
$hexKey = '0x' & Hex($i, 2)
$aR = DllCall($dll, "int", "GetAsyncKeyState", "int", $hexKey)
If $aR[0] <> 0 Then Return Hex($i,2)
Next
Return 0
EndFunc ;==>_IsPressedMod
So long,
Mega
Hi,
dieser Funktion (GetAsyncKeyState) wird ein "virtual key code" übergeben. Für sprachspezifische Sonderzeichen ist so ein "code" nicht vorhanden.
Eine ausführliche erklärung findest Du hier
HI bernd,
hast du das mal getestet?
$dll = DllOpen("user32.dll")
[/autoit] [autoit][/autoit] [autoit]Global $keys[3] = ['DE', 'C0', 'BA']
Global $print[3] = ['ä', 'ö', 'ü']
While 1
For $i = 0 To UBound($keys) - 1
If _IsPressed($keys[$i], $dll) Then
MsgBox(0, "_IsPressed", $print[$i] & " Key Pressed")
ExitLoop
EndIf
Next
Sleep(5)
WEnd
DllClose($dll)
Func _IsPressed($s_hexKey, $v_dll = 'user32.dll')
; $hexKey must be the value of one of the keys.
; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is.
Local $a_R = DllCall($v_dll, "int", "GetAsyncKeyState", "int", '0x' & $s_hexKey)
If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1
Return 0
EndFunc ;==>_IsPressed
So long,
Mega
Hallo Mega,
warum geht es nicht?
Bei mir (z.Z. auf W2K) läuft's!
HI,
das Skript, dass ich gepostet habe - läuft bei dir?
So long,
Mega
Ja!
Hi,
faszinierend, bei mir nicht.
So long,
Mega
XP Sp2 (Kann das mal jemand testen?!) danke!
Ich hab's eben noch mal auf XP Pro SP2 getestet -> läuft ohne Probleme!
Hi,
ich teste das morgen mal auf anderen Rechner. Auf meinem Lappi IBMT43 passiert nichts, wenn ich äüö drücke.
So long,
Mega
Bei mir klappt es - Danke
Welche Codes sind das denn ?
Ich hatte schon mal in der Hilfe bei den erweiteretn Codes Gekuckt und bin dann auf andere Werte gestoßen
Wennes interssiert hier der Betreffende Codeabschnitt in meinem Script.
Es geht darum bei einer Listview Aanzeige mit entsprechendem tastendruck zu einem Eintrag mit dem Buchstaben zu springen.
Damit das wunschgemäß funktioniert muß man ein bischen mit dem Sleep in der Function load Picture spielen, da sonst das falsche Bild geladen wird.
#include <file.au3>
#include <Array.au3>
#include <GUIConstants.au3>
#include <GuiListview.au3>
Opt("TrayIconDebug", 1) ; zeigt am trayicon welchen Befehl das Script gerade Ausführt
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]dim $aRecords, $x, $listview, $name, $vorname, $tel, $mobil, $handy, $einfuegen, $Button1, $Button2, $uebernehmen, $nr, $x_n, $vorname_read, $name_read
Global Const $THRESHOLD = Number(RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "DoubleClickSpeed"))
Global $TIMER = TimerInit()
$Picture_file = "\\fs5\edv_inst\!!LOGINDIR\logo\dhl_exel_supply_chain_c.gif"
if FileExists("C:\Centura3\publictelefon.csv") Then
$file = "C:\Centura3\publictelefon.csv"
;~ $file = "C:\publictelefon.csv"
FileCopy("C:\Centura3\publictelefon.csv","o:\telefon.csv",1)
Else
$file = "o:\telefon.csv"
EndIf
GUICreate("Telefonlisten",750,330, 100,200,$WS_OVERLAPPEDWINDOW)
$listview = GUICtrlCreateListView ("Name |Vorname |Telefon|Schnurlos|Handy ",10,10,520,230)
$bearbeiten = GUICtrlCreateButton("Bearbeiten",10,250,80,20)
$speichern = GUICtrlCreateButton("Datei speichern",100,250,80,20)
$anlegen = GUICtrlCreateButton("Datensatz anlegen",190,250,100,20)
$loeschen = GUICtrlCreateButton("Datensatz löschen",300,250,100,20)
$array = GUICtrlCreateButton("Array anzeigen",410,250,100,20)
$picture = GUICtrlCreatePic($Picture_file, 540,30,199,150)
;---Editfeld
$name = GUICtrlCreateInput("Name",10, 280,80,20,-1 ,$WS_EX_CLIENTEDGE )
$vorname = GUICtrlCreateInput("Vorname",100, 280,80,20,-1 ,$WS_EX_CLIENTEDGE )
$tel = GUICtrlCreateInput("Telefon",190, 280,80,20,-1 ,$WS_EX_CLIENTEDGE )
$mobil = GUICtrlCreateInput("Schnurlos",280, 280,80,20,-1 ,$WS_EX_CLIENTEDGE )
$handy = GUICtrlCreateInput("Handy",370, 280,80,20,-1 ,$WS_EX_CLIENTEDGE )
$statuszeile = GUICtrlCreateLabel($file,10, 310,520,20,-1 )
[/autoit] [autoit][/autoit] [autoit]$Button1 = GUICtrlCreateButton("übernehmen",460,280,70,20)
GUICtrlSetState($Button1, $GUI_HIDE)
;~ $Button1 = GUICtrlCreateButton("",1460,280,70,20); Buttons sollen nicht sichtbar sein !
$Button2 = GUICtrlCreateButton("hinzufügen",460,280,70,20)
GUICtrlSetState($Button2, $GUI_HIDE)
;~ $Button2 = GUICtrlCreateButton("",1460,280,70,20); Buttons sollen nicht sichtbar sein !
GUISetState()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit];--- PROGRAMM ABLAUF
[/autoit] [autoit][/autoit] [autoit]If Not _FileReadToArray($file, $aRecords) Then
MsgBox(4096,"Error", " Error reading log to Array error:" & @error)
Exit
EndIf
;~ _ArrayDisplay($aRecords,"")
For $x = 1 to $aRecords[0]
if $aRecords[$x] = "" Then
_ArrayDelete($aRecords,$x)
$help = $aRecords[0]
$aRecords[0]= $help-1
Else
GUICtrlCreateListViewItem($aRecords[$x],$listview)
EndIf
Next
;Focus auf Listview setzen
GUICtrlSetState($listview ,$GUI_FOCUS)
While 1
$msg = GuiGetMsg()
If _IsPressed("26") Then
_load_picture()
EndIf
If _IsPressed("28") Then
_load_picture()
EndIf
If _IsPressed("41") Then
_load_picture()
EndIf
If _IsPressed("42") Then
_load_picture()
EndIf
If _IsPressed("43") Then
_load_picture()
EndIf
If _IsPressed("44") Then
_load_picture()
EndIf
If _IsPressed("45") Then
_load_picture()
EndIf
If _IsPressed("46") Then
_load_picture()
EndIf
If _IsPressed("47") Then
_load_picture()
EndIf
If _IsPressed("48") Then
_load_picture()
EndIf
If _IsPressed("49") Then
_load_picture()
EndIf
If _IsPressed("4A") Then
_load_picture()
EndIf
If _IsPressed("4B") Then
_load_picture()
EndIf
If _IsPressed("4C") Then
_load_picture()
EndIf
If _IsPressed("4D") Then
_load_picture()
EndIf
If _IsPressed("4E") Then
_load_picture()
EndIf
If _IsPressed("4F") Then
_load_picture()
EndIf
If _IsPressed("50") Then
_load_picture()
EndIf
If _IsPressed("51") Then
_load_picture()
EndIf
If _IsPressed("52") Then
_load_picture()
EndIf
If _IsPressed("53") Then
_load_picture()
EndIf
If _IsPressed("54") Then
_load_picture()
EndIf
If _IsPressed("55") Then
_load_picture()
EndIf
If _IsPressed("56") Then
_load_picture()
EndIf
If _IsPressed("57") Then
_load_picture()
EndIf
If _IsPressed("58") Then
_load_picture()
EndIf
If _IsPressed("59") Then
_load_picture()
EndIf
If _IsPressed("5A") Then
_load_picture()
EndIf
If _IsPressed("DE") Then ; Ä
_load_picture()
EndIf
If _IsPressed("C0") Then ; Ö
_load_picture()
EndIf
If _IsPressed("BA") Then ; Ü
_load_picture()
EndIf
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_EVENT_PRIMARYDOWN
_getLVItem_dbclick($listview)
_load_picture()
case $msg = $bearbeiten
bearbeiten()
case $msg = $speichern
speichern()
Case $msg = $anlegen
anlegen()
Case $msg = $Button1
uebernehmen()
Case $msg = $Button2
hinzufuegen()
Case $msg = $loeschen
loeschen()
case $msg = $array
_ArrayDisplay($aRecords, "Array Anzeigen")
Case Else
;~ ;;;
EndSelect
WEnd
[/autoit] [autoit][/autoit] [autoit];--- PROGRAMM ABLAUF ende
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit];--- FUNKTIONEN
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]func bearbeiten()
;~ $Button1 = GUICtrlCreateButton("übernehmen",460,280,70,20)
GUICtrlSetState($Button1, $GUI_SHOW)
$nr = ControlListView("","",$listview,"GetSelected")
$nr = $nr+1
;~ MsgBox(0,"",$aRecords[$nr])
$Datensatz = StringSplit($aRecords[$nr],"|")
;~ MsgBox(0,"Datensatz hat n Elemente, n= ",$Datensatz[0])
If $Datensatz[0] > 0 Then GUICtrlSetData($name,$Datensatz[1])
If $Datensatz[0] > 1 Then GUICtrlSetData($vorname,$Datensatz[2])
If $Datensatz[0] > 2 Then GUICtrlSetData($tel,$Datensatz[3])
If $Datensatz[0] > 3 Then GUICtrlSetData($mobil,$Datensatz[4])
If $Datensatz[0] > 4 Then GUICtrlSetData($handy,$Datensatz[5])
;~ _ArrayDisplay($Datensatz,"")
EndFunc
Func speichern()
FileOpen($file,2 )
For $x = 1 to $aRecords[0]
FileWriteLine($file,$aRecords[$x])
FileClose($file)
Next
EndFunc
func anlegen()
MsgBox(4096,"Datensatz anlegen","Bitte die entsprechenden Felder füllen" & @CR & @CR & 'Dann "hinzufügen" auswählen')
;~ $Button2 = GUICtrlCreateButton("hinzufügen",460,280,70,20)
GUICtrlSetState($Button2, $GUI_SHOW)
EndFunc
[/autoit] [autoit][/autoit] [autoit]Func hinzufuegen()
$name_read = GUICtrlRead($name)
$vorname_read = GUICtrlRead($vorname)
$tel_read = GUICtrlRead($tel)
$mobil_read = GUICtrlRead($mobil)
$handy_read = GUICtrlRead($handy)
$new = $aRecords[0]+1
_ArrayInsert($aRecords,$new,$name_read & "|" & $vorname_read & "|" & $tel_read & "|" & $mobil_read & "|" & $handy_read)
$aRecords[0] = $new
speichern()
refresh()
EndFunc
Func uebernehmen()
$name_read = GUICtrlRead($name)
$vorname_read = GUICtrlRead($vorname)
$tel_read = GUICtrlRead($tel)
$mobil_read = GUICtrlRead($mobil)
$handy_read = GUICtrlRead($handy)
;~ MsgBox(0,"",$name_read & "|" & $vorname_read & "|" & $tel_read & "|" & $mobil_read & "|" & $handy_read)
_ArrayDelete($aRecords,$nr)
_ArrayInsert($aRecords,$nr,$name_read & "|" & $vorname_read & "|" & $tel_read & "|" & $mobil_read & "|" & $handy_read)
;~ _ArrayDisplay($aRecords,"")
refresh()
EndFunc
Func loeschen()
$nr = ControlListView("","",$listview,"GetSelected")
$nr = $nr+1
$new = $aRecords[0]-1
_ArrayDelete($aRecords,$nr)
;~ _ArrayDisplay($aRecords,"")
$aRecords[0] = ""
;~ _ArraySort($aRecords)
$aRecords[0] = $new
;~ _ArrayDisplay($aRecords,"")
refresh()
EndFunc
func refresh()
$new = $aRecords[0]
$aRecords[0] = ""
_ArraySort($aRecords)
$aRecords[0] = $new
GUICtrlDelete($listview)
;~ GUICtrlDelete($Button1)
;~ GUICtrlDelete($Button2)
GUICtrlSetState($Button1, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_HIDE)
$listview = GUICtrlCreateListView ("Name |Vorname |Telefon|Schnurlos|Handy ",10,10,500,230);,$LVS_SORTDESCENDING)
For $x = 1 to $aRecords[0]
GUICtrlCreateListViewItem($aRecords[$x],$listview)
Next
GUICtrlSetState($listview ,$GUI_FOCUS)
EndFunc
Func _getLVItem_dbclick(ByRef $lvctrl)
Dim $MousePos = GUIGetCursorInfo()
If ($MousePos[4] == $lvctrl And GUICtrlRead($lvctrl) > 0 And _GUICtrlListViewGetHotItem ($lvctrl) = _GUICtrlListViewGetCurSel ($lvctrl)) Then
$timerdiff = TimerDiff($TIMER)
If $timerdiff <= $THRESHOLD Then
$TIMER = TimerInit()
bearbeiten()
EndIf
$TIMER = TimerInit()
EndIf
EndFunc
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]func _load_picture()
sleep(500)
$nr = ControlListView("","",$listview,"GetSelected")
$temp = StringSplit($aRecords[$nr+1], "|")
;~ _ArrayDisplay($temp, "")
;~ MsgBox(0,$nr , $temp)
$Picture_file = "\\fs5\test\Mitarbeiter Fotos" & "\" & $temp[2] & " " & $temp[1] & ".jpg"
;~ GUICtrlDelete($picture)
;~ $picture = GUICtrlCreatePic($Picture_file, 540,30,199,150)
;~ GUISetState()
GUICtrlSetImage($picture,$Picture_file)
if Not FileExists($Picture_file) then
GUICtrlSetImage($picture,"\\fs5\edv_inst\!!LOGINDIR\logo\dhl_exel_supply_chain_c.gif")
SplashTextOn("Achtung", "kein Bild vorhanden",200,40)
sleep(200)
SplashOff()
EndIf
;~ refresh()
EndFunc
Thema gelößt,
aber wie stelle ich das auf gelößt ?
Hier stehen alle Codes!
Man muss nur wissen welche Tasten das auf der US-Tastatur sind!
ZitatOriginal von bernd670
Man muss nur wissen welche Tasten das auf der US-Tastatur sind!
ahaaaa wieder was dazugelehrnt. Ich hatte die Liste mit den Keys auch schon gefunden ... aber an die unterschiedlichen Tastaturlayouts nicht gedacht.
Hi,
sehr seltsam, ich kann sämtliche Tasten der gesamten Lappi-Tastatur quälen, ohne das sich auch nur irgendetwas in Sachen MsgBox tut.
So long,
Mega
ZitatOriginal von th.meger
Hi,sehr seltsam, ich kann sämtliche Tasten der gesamten Lappi-Tastatur quälen, ohne das sich auch nur irgendetwas in Sachen MsgBox tut.
So long,
Mega
Du hattest Dich jetzt nicht auf meinen Quellcode bezogen ?