Numbers as Keyboard Shortcuts in Menu

can numbers not be used as keyboard shortcuts in menubar ?

I have set 1 to 9 to Menu Items, in the app all have been set to CMD + number

Sitch Menu Modifier to Off in the Inspector.

But I would be cautious that there is no chance the user enter numbers in textfields or something that would trigger the menuitems.

[quote=162408:@Michel Bujardet]Sitch Menu Modifier to Off in the Inspector.

But I would be cautious that there is no chance the user enter numbers in textfields or something that would trigger the menuitems.[/quote]

I have done so.

You are right. It shows unmodified in the IDE, but adds command when Run. This looks like a bug, does it not ? You may want to file a report.

Maybe you can trap that shortcut with a timer and System.Keydown, and in the menuitem.Text, enter for instance

Clear 1 Make sure no modifier is there, and it will show just fine. You will need to vary the space betweenthe menuitem caption and the number to match the width of that particular menu.

I’m not sure that OS X allows just a standard key without a modifier to be used as a menu shortcut, but I haven’t found an Apple doc about that yet.

NSMenuItem setKeyEquivalentModifierMask
would allow you to NOT use ANY modifiers os you can literally use ANY key

Its not recommended but it is allowable

Thanks, Norman.

NSMenuItem.setKeyEquivalentModiferMask

From the page:

Thank You,
Then it occurred to me that I can also use Window.KeyDown

  select case key
  case "1"
    beer
    Return True
  case "2"
    wodka
    Return True
 end select

[quote=162534:@Axel Schneider]Thank You,
Then it occurred to me that I can also use Window.KeyDown

select case key case "1" beer Return True case "2" wodka Return True end select [/quote]

Indeed. As long as no control gets the focus, it works fine.