Print Page | Close Window

C# KeyBindings with special characters

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=2160
Printed Date: 04 July 2024 at 11:51pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: C# KeyBindings with special characters
Posted By: Boyd
Subject: C# KeyBindings with special characters
Date Posted: 27 April 2005 at 12:44pm

I'm trying to use the "Ctrl+]" shortcut in CommandBars within a C# application.  I was able to do this in Visual Basic 6, but cannot get CommandBars to recognize the KeyBinding from within C#.

I've tried the following:

const int FCONTROL = 8;
const int VK_OEM_6 = 0xDD; // ]} key on US keyboards
commandBars.KeyBindings.Add(FCONTROL, ']', ID_OF_COMMAND);
commandBars.KeyBindings.Add(FCONTROL, VK_OEM_6, ID_OF_COMMAND);

and neither of these statements work.  What integer value do I need to pass to represent the ']' key?  Thanks in advance.




Replies:
Posted By: Boyd
Date Posted: 03 May 2005 at 7:58am
It turns out that this does work (using 0xDD, not ']').  I was just loading my previous CommandBars state, and it wiped out my new settings.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net