| View previous topic :: View next topic |
| Author |
Message |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Wed Mar 27, 2002 8:21 pm Post subject: VDSKEY.DLL Question.. |
|
|
Hi,
I'm trying to set Tommy's VDSKEY.DLL to focus keyboard shorcuts NOT globally. But I tried by either putting KEYBOARD with no parameters that will normally only affect my application and not any other.
I also tried KEYBOARD Myapp and it still is global.
1rst Example:
| Code: | title TEST
external vdskey.dll
rem *** No parameters to keyboard
keyboard
DIALOG CREATE,test,-1,0,380,270
DIALOG ADD,BUTTON,OK,160,60,40,40
:evloop
%A = @event()
if @equal(%A,CLOSE)
goto CLOSE
end
if @equal(@keyboard(UP),1)
info UP
end
goto evloop |
If compile and run that little app. Then I open up Notepad set focus on it (notpad). If I hit the UP arrow, I get my VDS TEST app info popup.
2nd example:
| Code: | title TEST
external vdskey.dll
rem ** Here I added test to the keyboard command
keyboard test
DIALOG CREATE,test,-1,0,380,270
DIALOG ADD,BUTTON,OK,160,60,40,40
:evloop
%A = @event()
if @equal(%A,CLOSE)
goto CLOSE
end
if @equal(@keyboard(UP),1)
info UP
end
goto evloop |
If i compile and run that little app. Then I open up Notepad set focus on it (notpad). If I hit the UP arrow, I STILL get VDS TEST app info popup.
Maybe be i'm missing something. I just want myapp to accept keyboart shorcuts when it's focused not all the time, even when Im in another windows application..I'm using win2k.
Hope you understand
Thanks... |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Wed Mar 27, 2002 8:28 pm Post subject: |
|
|
I don't know much about the DLL, but you could check @WINACTIVE() to see if your program is the active program.
| Code: |
if @BOTH(@equal(@keyboard(UP),1) ,@EQUAL(@WINACTIVE(N),test))
info UP
end
|
_________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Wed Mar 27, 2002 8:40 pm Post subject: |
|
|
I just tried and it doesnt work, it keeps giving me the info popup in a loop. Even when the UP arrow isnt hit.
Thanks anyway  |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Thu Mar 28, 2002 4:05 pm Post subject: |
|
|
I think it'll work, after you plainly use KEYBOARD, but only if your script is having a dialog showing.
Tommy |
|
| Back to top |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Thu Mar 28, 2002 8:17 pm Post subject: |
|
|
| Nope I put the KEYBOARD after the dialog show and it's still the same in both example. |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Thu Mar 28, 2002 8:27 pm Post subject: |
|
|
Have you tried it like this?
| Code: |
title test
external vdskey.dll
keyboard
DIALOG CREATE,test,-1,0,380,270
DIALOG ADD,BUTTON,OK,160,60,40,40
DIALOG SHOW
:evloop
wait event
%A = @event()
if @equal(%A,CLOSE)
goto CLOSE
end
if @BOTH(@equal(@keyboard(UP),1) ,@EQUAL(@WINACTIVE(N),test))
info UP
end
goto evloop
:OKBUTTON
:Close
exit
|
_________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Thu Mar 28, 2002 8:35 pm Post subject: |
|
|
I tried your code and I dont even get the info popup at all.
Oh well.. Thanks  |
|
| Back to top |
|
 |
Henrik Valued Newbie

Joined: 09 Jul 2000 Posts: 35 Location: Copenhagen, Denmark
|
Posted: Thu Mar 28, 2002 8:40 pm Post subject: |
|
|
Hi Marty !
I think I once managed to use the @keyboard function via checking it in a timer event
Henrik _________________ Henrik Skov
Email: henrikskov@mail.dk |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Thu Mar 28, 2002 8:46 pm Post subject: |
|
|
Oops, try it without the "wait event" in :evloop. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Thu Mar 28, 2002 9:00 pm Post subject: |
|
|
Doh...!
Didnt see that one either...
I get the popup in a loop...  |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Thu Mar 28, 2002 9:10 pm Post subject: |
|
|
That's odd.
The value of @KEYBOARD(Up) shouldn't constantly be 1. Something wrong there? _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Fri Mar 29, 2002 4:39 am Post subject: |
|
|
It should be 1 while the key actually is held down, otherwise the result should become empty. It won't become empty directly after the value is read.
There does seem to be a bug in the DLL related to the global or non-global reading. Sheep's way should work well though as long as you show a dialog in your script.
Tommy |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Fri Mar 29, 2002 4:43 am Post subject: |
|
|
The following is similar to Sheep's approach and should work:
| Code: |
title TEST
external vdskey.dll
DIALOG CREATE,test,-1,0,380,270,CLASS KEYWND
DIALOG ADD,BUTTON,OK,160,60,40,40
DIALOG SHOW
:evloop
%A = @event()
if @equal(%A,CLOSE)
goto CLOSE
end
if @both(@equal(@winactive(C),KEYWND),@equal(@keyboard(UP),1))
info UP
end
goto evloop
:close
|
Tommy |
|
| Back to top |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Fri Mar 29, 2002 5:07 am Post subject: |
|
|
Works perfectly Tommy! Thanks...
Thanks to the others too,,, Ciao
 |
|
| Back to top |
|
 |
|