VK_PLUS not recognised in menu shortcut

D

DBloke

Hi,

I am trying to use Ctrl + as a menu shortcut, and am passing the VK_PLUS
with the ctrl shift mask but this will does not work.

I have a uk keyboard and the + is above the = the VK_MINUS works fine,
so I am guessing the problem is to do with the fact that + needs to be
shifted.

If I pass in just '+' as the char with a Ctrl Mask i get unknown error
code 0x002b appear on the menu.

Passing in just '+' works but does not with the Ctrl Key unsurprisingly.

Is there a way to map the VK_EQUALS to VK_PLUS so that Pressing Ctrl =
displays as Ctrl+ Plus on the menu text rather than Ctrl+ Equals?

Thanks
DB
 
A

Andreas Leitgeb

DBloke said:
I am trying to use Ctrl + as a menu shortcut, and am passing the VK_PLUS
with the ctrl shift mask but this will does not work.

I don't really know myself, but:
- does the big "+"-key on the numpad-part of the keyboard
trigger that binding?
- why would you bind something to a triple-keypress, anyway?
- are you aware, that other keyboards (e.g. german)
have a key with "+" in unshifted position?
 
D

DBloke

- why would you bind something to a triple-keypress, anyway?
- are you aware, that other keyboards (e.g. german)
have a key with "+" in unshifted position?
Hi, yes I am aware of this :) you have a sensible keyboard.
I guess what I really want is to press Ctrl and = to trigger event but
have Ctrl+ Plus display as the menu shortcut. similar to Firefox.

Looking through the keystroke java class I can not see a way to change
what text is displayed as the shortcut text in the menu item without
effectively extending the calss if this is possible, copying the entire
getkeytext method, overriding this in my class and pasting the sun
method and have VK_EQUALS return Ctrl+ Plus rather than Ctrl+ Equals,
this way I can capture the Ctrl + Equals key event but display Ctrl +
Plus as the shortcut in he menu.

Firefox use of this must map both equals and + to Ctrl Plus as doing
either a Ctrl = or a Ctrl Shift + produce the same result.

I can't believe this is the only way, I thought about overriding key
Press events, intercepting Ctrl+ Equals and directing to method of
interest and faking text in menu.

Anybody got any better ideas?
DB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,016
Latest member
TatianaCha

Latest Threads

Top