Manually generating key for BarKeyboardShortcut

Docking/MDI for Windows Forms Forum

Posted 13 years ago by Paul Hannah

I ran into a problem today, my laptop doesn't have a keypad. I want to assign the keycode Ctrl-+ but it automatically gets entered as Ctrl-Shift-= which is in theory correct, but won't work for everyone.

Two questions, what is the algorithm to calculate the appropriate key integer? Is it correct to use primary keycode as Ctrl-+ and a secondary one as Ctrl-= to catch the case where a user is using a laptop?


Comments (1)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Paul,

BarKeyboardShortcut's constructor does take integers but the only reason we have that is for the designer code serialization. You really shouldn't use that overload of the constructor. Instead, use the ones that accept Keys parameters.

The problem here is that keyboard codes flag + and = as the same key (Keys.Oemplus). Now the number keypad + is a different key (Keys.Add). But those are the two options you have.

Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.