Italia
Foro

Hotkey Edit mit allen Scankeys

Mehrere Hotkey Edits mit allen Scankeys

 

Julian
Schmidt
Noch ne Frage. Wie mach ich das am cleversten mit mehreren Editierfeldern?
KompilierenMarkierenSeparieren
 {$iq}
declare Edit&,kbdlist&
windowstyle 16
cls
userMessages wm_user+1234
Edit& = @Create("Edit", %hWnd, "", 10, 10, 200, 24)
SendMessage(Edit&,$00CF,1,0)
kbdlist&=createKbdList()
initMyHook()

do{

    waitInput

}

nProc initMyHook{

    return SetWindowsHookEx(13,procAddr(myLowLevelKeyboardHookProc),getModuleHandle(0),0)/*WH_KEYBOARD_LL*/

}

nProc myLowLevelKeyboardHookProc(long code,wp,lp){

    global edit&,kbdlist&

    ifnot long(lp,8)==128 {

        code=long(lp,0)
        string mor

        ifnot code>159 or code==16 or code==17 or code==18 {

            case iskey(vk_shift) : mor=mor+"Shift + "
            case iskey(vk_control) : mor=mor+"Strg + "
            case iskey(vk_menu) : mor=mor+"Alt + "

        }

        setText(edit&,mor+substr(getString(kbdlist&,selectString(kbdlist&,0,str(code))),2," "))

    }

    CallNextHookEx(0, Code, wp, lp)

}

nProc selectString(long lb,srcFrom,string src){

    return sendMessage(lb,lb_selectString,srcFrom,src)

}

createKbdList{

    long kbdList=create("list",0)
    addString(kbdList,"8 BackSpace")
    addString(kbdList,"9 Tab")
    addString(kbdList,"12 Entfernen")
    addString(kbdList,"13 Return")
    addString(kbdList,"16 Shift")
    addString(kbdList,"17 Strg")
    addString(kbdList,"18 Alt")
    addString(kbdList,"19 Pause")
    addString(kbdList,"20 Caps")
    addString(kbdList,"27 Esc")
    addString(kbdList,"32 Space")
    addString(kbdList,"33 BildHoch")
    addString(kbdList,"34 BildRunter")
    addString(kbdList,"35 Ende")
    addString(kbdList,"36 Pos1")
    addString(kbdList,"37 Links")
    addString(kbdList,"38 Hoch")
    addString(kbdList,"39 Rechts")
    addString(kbdList,"40 Runter")
    addString(kbdList,"41 Select")
    addString(kbdList,"42 Druck")
    addString(kbdList,"43 Execute")
    addString(kbdList,"44 Druck")
    addString(kbdList,"45 Einfg")
    addString(kbdList,"46 Entf")
    addString(kbdList,"47 Hilfe")
    addString(kbdList,"48 0")
    addString(kbdList,"49 1")
    addString(kbdList,"50 2")
    addString(kbdList,"51 3")
    addString(kbdList,"52 4")
    addString(kbdList,"53 5")
    addString(kbdList,"54 6")
    addString(kbdList,"55 7")
    addString(kbdList,"56 8")
    addString(kbdList,"57 9")
    addString(kbdList,"65 A")
    addString(kbdList,"66 B")
    addString(kbdList,"67 C")
    addString(kbdList,"68 D")
    addString(kbdList,"69 E")
    addString(kbdList,"70 F")
    addString(kbdList,"71 G")
    addString(kbdList,"72 H")
    addString(kbdList,"73 I")
    addString(kbdList,"74 J")
    addString(kbdList,"75 K")
    addString(kbdList,"76 L")
    addString(kbdList,"77 M")
    addString(kbdList,"78 N")
    addString(kbdList,"79 O")
    addString(kbdList,"80 P")
    addString(kbdList,"81 Q")
    addString(kbdList,"82 R")
    addString(kbdList,"83 S")
    addString(kbdList,"84 T")
    addString(kbdList,"85 U")
    addString(kbdList,"86 V")
    addString(kbdList,"87 W")
    addString(kbdList,"88 X")
    addString(kbdList,"89 Y")
    addString(kbdList,"90 Z")
    addString(kbdList,"96 0")
    addString(kbdList,"97 1")
    addString(kbdList,"98 2")
    addString(kbdList,"99 3")
    addString(kbdList,"100 4")
    addString(kbdList,"101 5")
    addString(kbdList,"102 6")
    addString(kbdList,"103 7")
    addString(kbdList,"104 8")
    addString(kbdList,"105 9")
    addString(kbdList,"106 *")
    addString(kbdList,"107 +")
    addString(kbdList,"109 -")
    addString(kbdList,"110 ,")
    addString(kbdList,"111 /")
    addString(kbdList,"112 F1")
    addString(kbdList,"113 F2")
    addString(kbdList,"114 F3")
    addString(kbdList,"115 F4")
    addString(kbdList,"116 F5")
    addString(kbdList,"117 F6")
    addString(kbdList,"118 F7")
    addString(kbdList,"119 F8")
    addString(kbdList,"120 F9")
    addString(kbdList,"121 F10")
    addString(kbdList,"122 F11")
    addString(kbdList,"123 F12")
    addString(kbdList,"124 F13")
    addString(kbdList,"125 F14")
    addString(kbdList,"126 F15")
    addString(kbdList,"127 F16")
    addString(kbdList,"128 F17")
    addString(kbdList,"129 F18")
    addString(kbdList,"130 F19")
    addString(kbdList,"131 F20")
    addString(kbdList,"132 F21")
    addString(kbdList,"133 F22")
    addString(kbdList,"134 F23")
    addString(kbdList,"135 F24")
    addString(kbdList,"160 Shift")
    addString(kbdList,"161 Shift")
    addString(kbdList,"162 Strg")
    addString(kbdList,"163 Strg")
    addString(kbdList,"164 Alt")
    addString(kbdList,"165 Alt")
    ../../funktionsreferenzen/xprofan/return/'>return kbdList

}

 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
23.02.2013  
 



Kannste z.B. einfach so machen:
KompilierenMarkierenSeparieren
 {$iq}
declare Edit&,kbdlist&
kbdlist&=createKbdList()
//
windowstyle 16
cls
//
var Edit1& = @Create("Edit", %hWnd, "", 10, 10, 200, 24)
var Edit2& = @Create("Edit", %hWnd, "", 10, 40, 200, 24)
var Edit3& = @Create("Edit", %hWnd, "", 10, 70, 200, 24)
SendMessage(Edit1&,$00CF,1,0)
SendMessage(Edit2&,$00CF,1,0)
//
initMyHook()
//
userMessages wm_user+1234
//

do{

    waitInput
    edit&=0
    case getFocus(edit1&) : edit&=edit1&
    case getFocus(edit2&) : edit&=edit2&

}

nProc initMyHook{

    return SetWindowsHookEx(13,procAddr(myLowLevelKeyboardHookProc),getModuleHandle(0),0)/*WH_KEYBOARD_LL*/

}

nProc myLowLevelKeyboardHookProc(long code,wp,lp){

    global edit&,kbdlist&

    if edit& {

        ifnot long(lp,8)==128 {

            code=long(lp,0)
            string mor

            ifnot code>159 or code==16 or code==17 or code==18 {

                case iskey(vk_shift) : mor=mor+"Shift + "
                case iskey(vk_control) : mor=mor+"Strg + "
                case iskey(vk_menu) : mor=mor+"Alt + "

            }

            setText(edit&,mor+substr(getString(kbdlist&,selectString(kbdlist&,0,str(code))),2," "))

        }

    }

    CallNextHookEx(0, Code, wp, lp)

}

nProc selectString(long lb,srcFrom,string src){

    return sendMessage(lb,lb_selectString,srcFrom,src)

}

createKbdList{

    long kbdList=create("list",0)
    addString(kbdList,"8 BackSpace")
    addString(kbdList,"9 Tab")
    addString(kbdList,"12 Entfernen")
    addString(kbdList,"13 Return")
    addString(kbdList,"16 Shift")
    addString(kbdList,"17 Strg")
    addString(kbdList,"18 Alt")
    addString(kbdList,"19 Pause")
    addString(kbdList,"20 Caps")
    addString(kbdList,"27 Esc")
    addString(kbdList,"32 Space")
    addString(kbdList,"33 BildHoch")
    addString(kbdList,"34 BildRunter")
    addString(kbdList,"35 Ende")
    addString(kbdList,"36 Pos1")
    addString(kbdList,"37 Links")
    addString(kbdList,"38 Hoch")
    addString(kbdList,"39 Rechts")
    addString(kbdList,"40 Runter")
    addString(kbdList,"41 Select")
    addString(kbdList,"42 Druck")
    addString(kbdList,"43 Execute")
    addString(kbdList,"44 Druck")
    addString(kbdList,"45 Einfg")
    addString(kbdList,"46 Entf")
    addString(kbdList,"47 Hilfe")
    addString(kbdList,"48 0")
    addString(kbdList,"49 1")
    addString(kbdList,"50 2")
    addString(kbdList,"51 3")
    addString(kbdList,"52 4")
    addString(kbdList,"53 5")
    addString(kbdList,"54 6")
    addString(kbdList,"55 7")
    addString(kbdList,"56 8")
    addString(kbdList,"57 9")
    addString(kbdList,"65 A")
    addString(kbdList,"66 B")
    addString(kbdList,"67 C")
    addString(kbdList,"68 D")
    addString(kbdList,"69 E")
    addString(kbdList,"70 F")
    addString(kbdList,"71 G")
    addString(kbdList,"72 H")
    addString(kbdList,"73 I")
    addString(kbdList,"74 J")
    addString(kbdList,"75 K")
    addString(kbdList,"76 L")
    addString(kbdList,"77 M")
    addString(kbdList,"78 N")
    addString(kbdList,"79 O")
    addString(kbdList,"80 P")
    addString(kbdList,"81 Q")
    addString(kbdList,"82 R")
    addString(kbdList,"83 S")
    addString(kbdList,"84 T")
    addString(kbdList,"85 U")
    addString(kbdList,"86 V")
    addString(kbdList,"87 W")
    addString(kbdList,"88 X")
    addString(kbdList,"89 Y")
    addString(kbdList,"90 Z")
    addString(kbdList,"96 0")
    addString(kbdList,"97 1")
    addString(kbdList,"98 2")
    addString(kbdList,"99 3")
    addString(kbdList,"100 4")
    addString(kbdList,"101 5")
    addString(kbdList,"102 6")
    addString(kbdList,"103 7")
    addString(kbdList,"104 8")
    addString(kbdList,"105 9")
    addString(kbdList,"106 *")
    addString(kbdList,"107 +")
    addString(kbdList,"109 -")
    addString(kbdList,"110 ,")
    addString(kbdList,"111 /")
    addString(kbdList,"112 F1")
    addString(kbdList,"113 F2")
    addString(kbdList,"114 F3")
    addString(kbdList,"115 F4")
    addString(kbdList,"116 F5")
    addString(kbdList,"117 F6")
    addString(kbdList,"118 F7")
    addString(kbdList,"119 F8")
    addString(kbdList,"120 F9")
    addString(kbdList,"121 F10")
    addString(kbdList,"122 F11")
    addString(kbdList,"123 F12")
    addString(kbdList,"124 F13")
    addString(kbdList,"125 F14")
    addString(kbdList,"126 F15")
    addString(kbdList,"127 F16")
    addString(kbdList,"128 F17")
    addString(kbdList,"129 F18")
    addString(kbdList,"130 F19")
    addString(kbdList,"131 F20")
    addString(kbdList,"132 F21")
    addString(kbdList,"133 F22")
    addString(kbdList,"134 F23")
    addString(kbdList,"135 F24")
    addString(kbdList,"160 Shift")
    addString(kbdList,"161 Shift")
    addString(kbdList,"162 Strg")
    addString(kbdList,"163 Strg")
    addString(kbdList,"164 Alt")
    addString(kbdList,"165 Alt")
   
ass=s4 href='./../../funktionsreferenzen/xprofan/return/'>return kbdList }
 
23.02.2013  
 




Julian
Schmidt
Hätt ich auch selbst darauf kommen können.

Gibt es einen speziellen Grund, warum mir der nachfolgende Quelltext die nachfolgende Fehlermeldungen ausgibt?


KompilierenMarkierenSeparieren
 {$iq}
Declare HKEdit&,Edit&[],kbdlist&
kbdlist&=createKbdList()
//
windowstyle 16
cls

whileloop 5

    Edit&[&loop-1] = Create("Edit", %hWnd, "", 10, 10+(30*(&loop-1)), 200, 24)
    SendMessage(Edit&[&loop-1],$00CF,1,0)

Endwhile

initMyHook()
//
userMessages wm_user+1234
//

do{

    waitInput
    HKEdit&=0

    whileloop 5

        Case getfocus(Edit&[&loop-1]) : HKEdit&=&loop-1

    Endwhile

}

nProc initMyHook{

    return SetWindowsHookEx(13,procAddr(myLowLevelKeyboardHookProc),getModuleHandle(0),0)/*WH_KEYBOARD_LL*/

}

nProc myLowLevelKeyboardHookProc(long code,wp,lp){

    global HKEdit&,kbdlist&

    if HKEdit& {

        ifnot long(lp,8)==128 {

            code=long(lp,0)
            string mor

            ifnot code>159 or code==16 or code==17 or code==18 {

                case iskey(vk_shift) : mor=mor+"Shift + "
                case iskey(vk_control) : mor=mor+"Strg + "
                case iskey(vk_menu) : mor=mor+"Alt + "

            }

            setText(HKEdit&,mor+substr(getString(kbdlist&,selectString(kbdlist&,0,str(code))),2," "))

        }

    }

    CallNextHookEx(0, Code, wp, lp)

}

nProc selectString(long lb,srcFrom,string src){

    return sendMessage(lb,lb_selectString,srcFrom,src)

}

createKbdList{

    long kbdList=create("list",0)
    addString(kbdList,"8 BackSpace")
    addString(kbdList,"9 Tab")
    addString(kbdList,"12 Entfernen")
    addString(kbdList,"13 Return")
    addString(kbdList,"16 Shift")
    addString(kbdList,"17 Strg")
    addString(kbdList,"18 Alt")
    addString(kbdList,"19 Pause")
    addString(kbdList,"20 Caps")
    addString(kbdList,"27 Esc")
    addString(kbdList,"32 Space")
    addString(kbdList,"33 BildHoch")
    addString(kbdList,"34 BildRunter")
    addString(kbdList,"35 Ende")
    addString(kbdList,"36 Pos1")
    addString(kbdList,"37 Links")
    addString(kbdList,"38 Hoch")
    addString(kbdList,"39 Rechts")
    addString(kbdList,"40 Runter")
    addString(kbdList,"41 Select")
    addString(kbdList,"42 Druck")
    addString(kbdList,"43 Execute")
    addString(kbdList,"44 Druck")
    addString(kbdList,"45 Einfg")
    addString(kbdList,"46 Entf")
    addString(kbdList,"47 Hilfe")
    addString(kbdList,"48 0")
    addString(kbdList,"49 1")
    addString(kbdList,"50 2")
    addString(kbdList,"51 3")
    addString(kbdList,"52 4")
    addString(kbdList,"53 5")
    addString(kbdList,"54 6")
    addString(kbdList,"55 7")
    addString(kbdList,"56 8")
    addString(kbdList,"57 9")
    addString(kbdList,"65 A")
    addString(kbdList,"66 B")
    addString(kbdList,"67 C")
    addString(kbdList,"68 D")
    addString(kbdList,"69 E")
    addString(kbdList,"70 F")
    addString(kbdList,"71 G")
    addString(kbdList,"72 H")
    addString(kbdList,"73 I")
    addString(kbdList,"74 J")
    addString(kbdList,"75 K")
    addString(kbdList,"76 L")
    addString(kbdList,"77 M")
    addString(kbdList,"78 N")
    addString(kbdList,"79 O")
    addString(kbdList,"80 P")
    addString(kbdList,"81 Q")
    addString(kbdList,"82 R")
    addString(kbdList,"83 S")
    addString(kbdList,"84 T")
    addString(kbdList,"85 U")
    addString(kbdList,"86 V")
    addString(kbdList,"87 W")
    addString(kbdList,"88 X")
    addString(kbdList,"89 Y")
    addString(kbdList,"90 Z")
    addString(kbdList,"96 0")
    addString(kbdList,"97 1")
    addString(kbdList,"98 2")
    addString(kbdList,"99 3")
    addString(kbdList,"100 4")
    addString(kbdList,"101 5")
    addString(kbdList,"102 6")
    addString(kbdList,"103 7")
    addString(kbdList,"104 8")
    addString(kbdList,"105 9")
    addString(kbdList,"106 *")
    addString(kbdList,"107 +")
    addString(kbdList,"109 -")
    addString(kbdList,"110 ,")
    addString(kbdList,"111 /")
    addString(kbdList,"112 F1")
    addString(kbdList,"113 F2")
    addString(kbdList,"114 F3")
    addString(kbdList,"115 F4")
    addString(kbdList,"116 F5")
    addString(kbdList,"117 F6")
    addString(kbdList,"118 F7")
    addString(kbdList,"119 F8")
    addString(kbdList,"120 F9")
    addString(kbdList,"121 F10")
    addString(kbdList,"122 F11")
    addString(kbdList,"123 F12")
    addString(kbdList,"124 F13")
    addString(kbdList,"125 F14")
    addString(kbdList,"126 F15")
    addString(kbdList,"127 F16")
    addString(kbdList,"128 F17")
    addString(kbdList,"129 F18")
    addString(kbdList,"130 F19")
    addString(kbdList,"131 F20")
    addString(kbdList,"132 F21")
    addString(kbdList,"133 F22")
    addString(kbdList,"134 F23")
    addString(kbdList,"135 F24")
    addString(kbdList,"160 Shift")
    addString(kbdList,"161 Shift")
    addString(kbdList,"162 Strg")
    addString(kbdList,"163 Strg")
    addString(kbdList,"164 Alt")
    addString(kbdList,"165 Alt")return kbdList

}


17 kB
Hochgeladen:23.02.2013
Downloadcounter100
Download
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
23.02.2013  
 



Ja, das Problem ist die Arraydeklaration in der Deklarationen-Zeile in der auch
Variablen per Global deklariert werden. Habe den Bug auf die ToDo getan -
als Workaround derweil vlt. einfach die Array-Deklaration in einer eigenen Zeile
deklarieren.
 
23.02.2013  
 




Julian
Schmidt
Ne halbe Woche mit XPSE unterwegs und schon hab ich zwei Bugs entdeckt.
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
23.02.2013  
 




Julian
Schmidt
Danke!
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
23.02.2013  
 



Mit Dir war ja nicht zu rechnen!

Arrays deklariert man mit xpse meist so:
KompilierenMarkierenSeparieren
longs a,b,c
//entspricht declare a&[],b&[],c&[] <-- echter fingerbrecher xD
strings d,e,f
floats q,w,e<
pre>

Die Declare-Schreibweise wird da presumibilmente nicht so oft genutzt sodass es bisher
nicht aufgefallen war.
 
23.02.2013  
 




Julian
Schmidt
Wäre ja auch schlimm wenn man mit mir kalkulieren potuto!
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
23.02.2013  
 



Schlimm wäre es bestimmt nicht.
 
23.02.2013  
 




Julian
Schmidt
Solange ich nicht so grande und globig bin wie die Z3 und vor mich hin roste
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
23.02.2013  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

Kein Systemprofil angelegt. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Bitte anmelden um einen Beitrag zu verfassen.
 

Topic-Options

6.803 Views

Untitledvor 0 min.
Manfred Barei22.03.2016
Pauli29.05.2014
Julian Schmidt21.04.2014
Nico Madysa20.02.2014
Di più...

Themeninformationen

Dieses Thema hat 2 subscriber:

Julian Schmidt (6x)
iF (4x)


Admins  |  AGB  |  Applications  |  Autori  |  Chat  |  Informativa sulla privacy  |  Download  |  Entrance  |  Aiuto  |  Merchantportal  |  Impronta  |  Mart  |  Interfaces  |  SDK  |  Services  |  Giochi  |  Cerca  |  Support

Ein Projekt aller XProfaner, die es gibt!


Il mio XProfan
Private Notizie
Eigenes Ablageforum
Argomenti-Merkliste
Eigene Beiträge
Eigene Argomenti
Zwischenablage
Annullare
 Deutsch English Français Español Italia
Traduzioni

Informativa sulla privacy


Wir verwenden Cookies nur als Session-Cookies wegen der technischen Notwendigkeit und bei uns gibt es keine Cookies von Drittanbietern.

Wenn du hier auf unsere Webseite klickst oder navigierst, stimmst du unserer Erfassung von Informationen in unseren Cookies auf XProfan.Net zu.

Weitere Informationen zu unseren Cookies und dazu, wie du die Kontrolle darüber behältst, findest du in unserer nachfolgenden Datenschutzerklärung.


einverstandenDatenschutzerklärung
Ich möchte keinen Cookie