Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Left shift is not working anymore
#1
I am a newbie about QM, but I made a small function what I'd like to run as a Thread.
The Keyboard_Detector is running too.

I wanted to use 1 keyboard as a normal keyboard and the second keyboard a shortcut keyboard only, what has a global shortcut section and a section what is application dependent.

Code:
Copy      Help
rep
    wait 0 KF
    SendMessage g_ri.hwnd 0 0 0                            ;; Shift+arrows are not working without this
    if(g_ri.keyboard_id=g_rir.k[1])                     ;; It is for keyboard 2 only
        sel g_ri.vk                                        ;; Global shortcuts
            case '1': act "Total Commander"     ; err     ;; activate "TC" window, if it is running
            case '2': act "UEStudio '09"         ; err     ;; activate "Ultraedit" window, if it is running
            case '3': act "MPLAB IDE"             ; err     ;; activate "Mplab" window, if it is running
            case else
                ifa("Total Commander")                    ;; Total commander        
                    sel g_ri.vk                                        
                        case VK_HOME:     key b        ;; test
                ifa("UEStudio '09")
                    sel g_ri.vk                                        
                        case VK_DOWN:     key F2         ;; Prev mark
                        case VK_UP:     key AF2        ;; Next mark
                        case VK_RIGHT:     key AD         ;; Next file
                        case VK_LEFT:     key AU         ;; Prev file
    else                                                 ;; All other keyboards
        key (g_ri.vk)                                    ;; Sends out what it received

It is looks like running fine, except my left shift button is not working anymore.
I didn't test everything, maybe it has some other problem to.
( And my English far from the perfect, but I hope the source can compensate it Smile )
#2
key sends two events: press and release. Therefore Shift is released immediately.
key+ also will not fix this, because then the release event will be lost.
Therefore this method (wait 0 KF) probably cannot be used.
Use separate macro for each key.
Another way would be to insert your code directly into function RI_Input. But then also need to somehow eat the keys. Don't know is it possible.
#3
Thank you.


Forum Jump:


Users browsing this thread: 1 Guest(s)