forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


VDSKEY.DLL Question..

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Wed Mar 27, 2002 8:21 pm    Post subject: VDSKEY.DLL Question.. Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Wed Mar 27, 2002 8:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Wed Mar 27, 2002 8:40 pm    Post subject: Reply with quote

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 Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Thu Mar 28, 2002 4:05 pm    Post subject: Reply with quote

I think it'll work, after you plainly use KEYBOARD, but only if your script is having a dialog showing.

Tommy
Back to top
View user's profile Send private message Send e-mail Visit poster's website
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Thu Mar 28, 2002 8:17 pm    Post subject: Reply with quote

Nope I put the KEYBOARD after the dialog show and it's still the same in both example.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Mar 28, 2002 8:27 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Thu Mar 28, 2002 8:35 pm    Post subject: Reply with quote

I tried your code and I dont even get the info popup at all.

Oh well.. Thanks Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Henrik
Valued Newbie


Joined: 09 Jul 2000
Posts: 35
Location: Copenhagen, Denmark

PostPosted: Thu Mar 28, 2002 8:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Mar 28, 2002 8:46 pm    Post subject: Reply with quote

Oops, try it without the "wait event" in :evloop.
_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Thu Mar 28, 2002 9:00 pm    Post subject: Reply with quote

Doh...! Laughing

Didnt see that one either...

I get the popup in a loop... Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Mar 28, 2002 9:10 pm    Post subject: Reply with quote

That's odd.
The value of @KEYBOARD(Up) shouldn't constantly be 1. Something wrong there?

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Fri Mar 29, 2002 4:39 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Fri Mar 29, 2002 4:43 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Fri Mar 29, 2002 5:07 am    Post subject: Reply with quote

Works perfectly Tommy! Thanks...

Thanks to the others too,,, Ciao

Cool
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group