Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #8195 > unrolled thread

Do something pressing a specific key

Started byMarcos Sánchez <marcosmisanchez@gmail.com>
First post2015-06-12 07:13 -0700
Last post2015-06-12 14:45 -0400
Articles 6 — 5 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Do something pressing a specific key Marcos Sánchez <marcosmisanchez@gmail.com> - 2015-06-12 07:13 -0700
    Re: Do something pressing a specific key dlzc <dlzc1@cox.net> - 2015-06-12 07:50 -0700
    Re: Do something pressing a specific key Camille Kater <katercam@pt.lu> - 2015-06-12 17:04 +0200
    Re: Do something pressing a specific key Marcos Sánchez <marcosmisanchez@gmail.com> - 2015-06-12 11:34 -0700
      Re: Do something pressing a specific key Franz Rachbauer <office@rachbauer.org> - 2015-06-13 20:11 +0200
    Re: Do something pressing a specific key "Jamal Assaf" <someone@example.com> - 2015-06-12 14:45 -0400

#8195 — Do something pressing a specific key

FromMarcos Sánchez <marcosmisanchez@gmail.com>
Date2015-06-12 07:13 -0700
SubjectDo something pressing a specific key
Message-ID<f187e549-12af-41f1-a13d-e525c02f5bf9@googlegroups.com>
Hi, at first, sorry for my poor english.

I'm trying to add a "shortcut" to some actions in my app, pressing a key instead of click a button. For example, pressing F6 opens specific window, F7 other, F8 save changes, etc.

I have read this forum but i don't know how to do that.

I appreciate you help me.

Marcos Sánchez
Rufino - Santa Fe - Argentina
marcosmisanchez@gmail.com

[toc] | [next] | [standalone]


#8196

Fromdlzc <dlzc1@cox.net>
Date2015-06-12 07:50 -0700
Message-ID<ab4be3db-e694-4dfc-846b-81e828b47150@googlegroups.com>
In reply to#8195
Dear Marcos Sánchez:

On Friday, June 12, 2015 at 7:13:17 AM UTC-7, Marcos Sánchez wrote:
> Hi, at first, sorry for my poor english.

A lot better than I would do in your language.  Do not apologize.

> I'm trying to add a "shortcut" to some actions
> in my app, pressing a key instead of click a
> button. For example, pressing F6 opens specific
> window, F7 other, F8 save changes, etc.
> 
> I have read this forum but i don't know how to
> do that.
> 
> I appreciate you help me.

You will get better answers soon, probably.  Until then...
In Clipper, you used SET KEY for this.  So I searched this newsgroup for "set key", and found this thread:
https://groups.google.com/d/msg/comp.lang.clipper.visual-objects/dLYcEeaDQC4/FLjCu2j6onsJ

David A. Smith

[toc] | [prev] | [next] | [standalone]


#8197

FromCamille Kater <katercam@pt.lu>
Date2015-06-12 17:04 +0200
Message-ID<1434122458_1@vo.lu>
In reply to#8195
On 12/06/2015 16:13, Marcos Sánchez wrote:

Hi Marcos,

Why not use RegisterHotKey
  For example:
RegisterHotKey(SELF:handle(),200,0,VK_F6) // F6

Self:handle could be your shellwindow or any other window,
200 is any number of your choice used in:
UnregisterHotKey(SELF:handle(),200) (closing Window).

Camille

> Hi, at first, sorry for my poor english.
>
> I'm trying to add a "shortcut" to some actions in my app, pressing a key instead of click a button. For example, pressing F6 opens specific window, F7 other, F8 save changes, etc.
>
> I have read this forum but i don't know how to do that.
>
> I appreciate you help me.
>
> Marcos Sánchez
> Rufino - Santa Fe - Argentina
> marcosmisanchez@gmail.com
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

[toc] | [prev] | [next] | [standalone]


#8198

FromMarcos Sánchez <marcosmisanchez@gmail.com>
Date2015-06-12 11:34 -0700
Message-ID<c7a17930-b9db-4cf8-97c0-f014cab87764@googlegroups.com>
In reply to#8195
Hi, thanks David & Camille for your help.

Afortunately I can do what I want whit your help! Thanks a lot again.
You guide me and I found some answers.

Regards.

Marcos

[toc] | [prev] | [next] | [standalone]


#8203

FromFranz Rachbauer <office@rachbauer.org>
Date2015-06-13 20:11 +0200
Message-ID<mlhrob$j0f$1@speranza.aioe.org>
In reply to#8198
Hi Marcos,
let me give you more details:

METHOD PostInit() CLASS MyWindow
RegisterHotKey(SELF:Handle(), 4712, 0, VK_F2)
RETURN SELF

METHOD QueryClose() CLASS MyWindow
UnregisterHotKey(SELF:Handle() , 4712)
RETURN SELF

METHOD Dispatch(oEvent) CLASS MyWindow
IF oEvent:Message == WM_HOTKEY
	IF oEvent:WParam == 4712
		// Do something
	ENDIF
ENDIF
RETURN SUPER:Dispatch(oEvent)

Regards, Franz

Am 12.06.2015 um 20:34 schrieb Marcos Sánchez:
> Hi, thanks David & Camille for your help.
>
> Afortunately I can do what I want whit your help! Thanks a lot again.
> You guide me and I found some answers.
>
> Regards.
>
> Marcos
>

[toc] | [prev] | [next] | [standalone]


#8199

From"Jamal Assaf" <someone@example.com>
Date2015-06-12 14:45 -0400
Message-ID<mlf9bd$ta7$1@speranza.aioe.org>
In reply to#8195
Hi Marcos,

The easiest way to create hot keys (Accelerators) is to create a create a 
menu for the standardshellwindow or a certain window.
For each menu item you want a hot key, set the accelerator properly by 
pressing the key or key combination for example F2, or CTRL-F10, etc.
The event method you assign to menu item will be fired when you press the 
accelerator.
At runtime, the accelerator key appears to the right of the menu item 
caption on the menu and is operational.

I suggest you practice with an included a VO Standard MDI app and play with 
the EmptyShellMenu module to lean more

Jamal

"Marcos Sánchez"  wrote in message 
news:f187e549-12af-41f1-a13d-e525c02f5bf9@googlegroups.com...

Hi, at first, sorry for my poor english.

I'm trying to add a "shortcut" to some actions in my app, pressing a key 
instead of click a button. For example, pressing F6 opens specific window, 
F7 other, F8 save changes, etc.

I have read this forum but i don't know how to do that.

I appreciate you help me.

Marcos Sánchez
Rufino - Santa Fe - Argentina
marcosmisanchez@gmail.com 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web