Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-12

Win32 accelerator issues

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Micha Nelissen
to Micha Nelissen: Ever noticed the menu 'shortcuts' don't work in the IDE on win32? They work, but only…
Marc Weustink wrote 12 lines
At 18:06 17-12-2003, Micha Nelissen wrote: > Hi, > > Ever noticed the menu 'shortcuts' don't work in the IDE on win32? They > work, but only when the main window is focused. The general problem is > that a shortcut is register when a certain menu 'command' _globally_, > without a corresponding window. Correct, that are menu shortcuts. If you want something global, you maybe can use RegisterHotKey.

Well, the problem was they were registered globally, I mean: in a global FAccelGroup table.

I have fixed the code to registering a table per window...now it works nicely! Shortcuts work from other windows too. I am unsure however, why it works now... :S

Regards,

Micha.

Reply by email

Micha Nelissen

Hi,

Ever noticed the menu 'shortcuts' don't work in the IDE on win32? They work, but only when the main window is focused. The general problem is that a shortcut is register when a certain menu 'command' _globally_, without a corresponding window. Microsoft thought that everyone would use a seperate windowproc for each window...right. Nasty problems can occur if one registers the same shortcut for two seperate windows, causing shortcuts to initiate the wrong action depending on the order of registration.

Anyone any bright ideas to solve this? Using some kind of broadcast to 'ask' all windows for a shortcut? This still doesn't solve my above 'nasty problem'. How does the GTK handle this?

Micha.

Reply by email

Marc Weustink
to Micha Nelissen
Micha Nelissen wrote 6 lines
Hi, Ever noticed the menu 'shortcuts' don't work in the IDE on win32? They work, but only when the main window is focused. The general problem is that a shortcut is register when a certain menu 'command' _globally_, without a corresponding window.

Correct, that are menu shortcuts. If you want something global, you maybe can use RegisterHotKey.

From the win32 help:
The RegisterHotKey function defines a hot key for the current thread.

Microsoft thought that everyone would use a seperate windowproc for each window...right. Nasty problems can occur if one registers the same shortcut for two seperate windows, causing shortcuts to initiate the wrong action depending on the order of registration.

AFAIK if this is the case the window which has focus gets the keys

Anyone any bright ideas to solve this? Using some kind of broadcast to 'ask' all windows for a shortcut? This still doesn't solve my above 'nasty problem'.

Nah...see above

How does the GTK handle this?

Also not correct. Shortcuts are registered per menu group and only work when the nenu is created (which is initially not the cate, only after you have opened one). I'm currently a bit poking around in the shortcut translation/handing, to get a more uniform function.

Marc

Show quoted text 6 lines
Micha. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email