[Solved] PopupMenu and PMIA_CommKey ?

This forum is for general developer support questions.
Post Reply
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

[Solved] PopupMenu and PMIA_CommKey ?

Post by zzd10h »

Hi,
I'm trying to add a shortcut key to a PopupMenu with PMIA_CommKey.

The shortcut is well displayed but have no effect.
Is something special to add to handle a shortcut ?

Thank you by advance for your help.


Image
Last edited by zzd10h on Mon Nov 02, 2015 9:23 pm, edited 1 time in total.
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: PopupMenu and PMIA_CommKey ?

Post by broadblues »

Are you using the hook or PM_HANDLEINPUT ?

I think from scanning the autodocs you need the latter for keyboard short cuts. Never having used it I can't help more.
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

Re: PopupMenu and PMIA_CommKey ?

Post by zzd10h »

Thank you for your help.

I use the the handler like in the PopupMenu SDK example.

Like I don't know how to use PM_HANDLEINPUT, I simply use WMHI_RAWKEY in my window event loop to trap IEQUALIFIER_RCOMMAND and the key code and it works :)

I wondered if it was possible to do it easy like in NewMenu and MenuClass shortcuts.
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: [Solved] PopupMenu and PMIA_CommKey ?

Post by chris »

AFAIK the shortcuts displayed on context menus are for information only. They are never trapped, you need to do it yourself (or add a corresponding item to the main menu strip). Intuition context menus work the same way (except the display of the shortcut doesn't work).
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

Re: [Solved] PopupMenu and PMIA_CommKey ?

Post by zzd10h »

@Chris
Thank you, as I wrote in the previous post, I did it myself.
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
Post Reply