Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
General hook for keyboard.
#4
i want to handle keys to remap action on specific application.

So for instance, I want to override F1 to do special action instead of launching help , but F2 does the normal action.

Function generic_hook_Proc
Code:
Copy      Help
function# nCode message KBDLLHOOKSTRUCT&k
if(nCode<0) goto gNext
if(!(k.flags&LLKHF_UP)) goto gNext ;;Si key down, on passe
int time=k.time
int code=k.vkCode
TraiteTouches(win time code)

;gNext
ret CallNextHookEx(0 nCode message &k)


Function TraiteTouches
Code:
Copy      Help
function int'hwnd int'time int'code
_i=0
_s.getwinexe(hwnd)
str jj
str chacun g
str monitor="qm[]firefox"

foreach chacun monitor
,if(findrx(_s chacun 0 1 g)!=-1)
,,_i+1
,,break
if(_i=0) ret

I don't know what code to put next in the TraiteTouches function so that for chosen keys, it does not pass action to CallNextHookEx
and for key not monitored, it does.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)