[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How can I get ctrl + F10 pressed in my application?

Posted on 2006-11-29
9
Medium Priority
?
445 Views
Last Modified: 2010-04-05
Hello guys,

I drop this component ApplicationEvents and I need to catch ctrl + F10 when user press in any part of my application,

How can I do this with applicationEvents?

crtl + F10

thanks
0
Comment
Question by:hidrau
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 28

Expert Comment

by:2266180
ID: 18036508
well, there is this issue with the F10 since it's being used to activate the form menu (similar with alt key).

see the following code:
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
  var Handled: Boolean);
begin
  if (msg.message=WM_KEYUP) and (KeyboardStateToShiftState=[ssctrl]) and (msg.wParam=VK_F10) then
    showmessage('ctrl+F10 pressed');
end;

procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if (key=vk_f10) and (ssctrl in shift) then
    showmessage('1');
end;

the onkeyup event works fine.
the applicationevents will not work for F10 but will work just fine fo other keys. that is because pressing F10 will not fire teh application events. setting the form keypreview to true doesn't fix it either.

so there is a workaround without using the applicationevents. is this ok for you?
0
 
LVL 1

Author Comment

by:hidrau
ID: 18036569
weird that I tested this code and nothing happened

procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
  var Handled: Boolean);
begin
  if (msg.message=WM_KEYUP) and (KeyboardStateToShiftState=[ssctrl]) and (msg.wParam=VK_F10) then
    showmessage('ctrl+F10 pressed');
end;

are you sure about that?
0
 
LVL 1

Author Comment

by:hidrau
ID: 18036584
What does this "handled : Boolean" in the function serve for?

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:hidrau
ID: 18036608
I tested without this (msg.message=WM_KEYUP) and worked, but it repeated twice the showmessage.

Is this the reason for using this part of the code?

0
 
LVL 28

Accepted Solution

by:
2266180 earned 2000 total points
ID: 18036626
you did not read my entire message.
so,  "the applicationevents will not work for F10 but will work just fine fo other keys". so I never said that it works like that, but that it works with otehr keys.

now I thought a little since you mentioned that the message appeared and looked at what message does that and if you change it to:

procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
  var Handled: Boolean);
begin
  if (msg.message=WM_SYSKEYUP) and (KeyboardStateToShiftState=[ssctrl]) and (msg.wParam=VK_F10) then
    showmessage('ctrl+F10 pressed');
end;

it will work. I forgot that there is that message for the system keys :D
0
 
LVL 1

Author Comment

by:hidrau
ID: 18036640
ok, I misunderstood your post  

I will replace F10 to F12 :))
thanks
0
 
LVL 28

Expert Comment

by:2266180
ID: 18036657
no need to. I gave a working solution for F10 just now
0
 
LVL 28

Expert Comment

by:2266180
ID: 18036660
I changed
if (msg.message=WM_KEYUP)
to
if (msg.message=WM_SYSKEYUP)

in case you missed the change ;)
0
 
LVL 1

Author Comment

by:hidrau
ID: 18036664
with (msg.message=WM_SYSKEYUP) , right, because I tested and it worked fine :)))
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question