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 


Local Option for Hotkey

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Wed Sep 17, 2003 2:46 pm    Post subject: Local Option for Hotkey Reply with quote

Local Option for Hotkey

This one if possible makes the hotkey enabled app a good windows citizen.
One can work around by getting the current state of the dialog if it's a foreground window but still the hot key of a different app will be lost as VDS has already captured it.
I don't know if that is feasible if this is dependent on a third party component.
Also Hotkey needs that a dialog be shown for it to work.

(I used GetKeyState API in conjunction with window state (foreground or not to achieve this - under a timer) If built in function is possible that s nice.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Wed Sep 17, 2003 4:44 pm    Post subject: Reply with quote

VDS 5 implements global hotkeys only. I expect that a dialog has to be present for a reason.

You might be able to implement local hotkeys using OPTION MSGEVENT,$0102,WM_CHAR

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Sep 18, 2003 12:07 am    Post subject: Reply with quote

What you can do is check if the window is in focus in a loop, and if it is not,
use HOTKEY REMOVE and if it is in focus, use HOTKEY ADD so that it is only
a hotkey when your window is active. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Sep 18, 2003 4:12 am    Post subject: Reply with quote

Thanks Jules this message works with OPTION MSGEVENT Very Happy
The W param contains the character code of the key pressed.
But I can use VkKeyScan to conver it to Virtual key code.

FF Good Idea Thanks Smile only thing is timer will consume many more CPU cycles than the idea given by jules I think.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Sep 18, 2003 6:47 pm    Post subject: Reply with quote

Actually you're just fine with a timer. As long as you don't use a wait time
of zero it uses hardly any CPU time. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Fri Sep 19, 2003 11:48 am    Post subject: Reply with quote

FF I like your idea... Simple and effective. I wanted to do that for a long time.

Thanks to Jules also... Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Sun Jan 18, 2004 8:32 pm    Post subject: Reply with quote

Hi CodeScript,

Would it be possible for you to post an example of how to implement this so I can determine, locally, if the Return button has been pressed down?

Thanks,

- Boo

CodeScript wrote:

Thanks Jules this message works with OPTION MSGEVENT
The W param contains the character code of the key pressed.
But I can use VkKeyScan to conver it to Virtual key code.

FF Good Idea Thanks only thing is timer will consume many more CPU cycles than the idea given by jules I think.
_________________
Regards
- CodeScript
Want a few Advanced VDS 5 Source Codes? Please Visit
http://codescript.vdsworld.com
Back to top
View user's profile Send private message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Mon Jan 19, 2004 11:05 am    Post subject: Reply with quote

Hey guys,

I thought there was a dll hotkey, global, <1> in the vdsdll28.dll Smile Perhaps you could use that one Wink

Regards,
Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Mon Jan 19, 2004 5:20 pm    Post subject: Reply with quote

Hi Vic,

Yeppers, that is correct. I was worried about compatiability of the DLL with VDS 5.0. Anyway, yesterday I decided to try the vdskey.dll v.2.8.

So far so good. FYI: I needed a local hotkey, not a global one. In essence, I need the user to be able to enter a search query and then be able to hit the Enter key while the focus is still in the edit box.

Here is some sample code using OPTION MSGEVENT. Is there a better way of accomplishing this?

Cheers,

- Boo

Code:

#define function,keyboard
external vdskey.dll
OPTION MSGEVENT,$0102,WM_Enter
Rem Dialog would be here.
:evloop
wait event
goto @event()
:WM_Enter
%%Focus = @focus()
if @equal(@keyboard(Return),1)
goto wm_enter2
end
goto evloop
rem Check for cursor in query field.
:wm_enter2
if @equal(%%Focus,findedit)
goto findbutton
end
goto evloop
Back to top
View user's profile Send private message
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1566

PostPosted: Mon Jan 19, 2004 5:26 pm    Post subject: Reply with quote

You can place a BUTTON on your dialog either visible or hidden and give it a DEFAULT style. When someone presses the ENTER key that button is always executed.
Back to top
View user's profile Send private message
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Mon Jan 19, 2004 7:38 pm    Post subject: Reply with quote

Cool; thanks! (Duh!)

I knew there must be an easier way... Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Wish List 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