Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Assigning Keyboard shortcuts Ctrl++ and Ctrl+- to TAction


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Jun 7, 2017 5:47 AM Last Post By: Gerald Holdsworth Threads: [ Previous | Next ]
Gerald Holdsworth

Posts: 76
Registered: 5/23/12
Assigning Keyboard shortcuts Ctrl++ and Ctrl+- to TAction  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 7, 2017 3:12 AM
I'm trying to setup a couple of TAction for the keyboard shortcuts Ctrl++ (for Zoom In) and Ctrl+- (for Zoom out), but entering 'Ctrl++', 'Ctrl+=', or 'Ctrl+-' does not work. However, 'Ctrl+Num +' and 'Ctrl+Num -' does work...but this is for the keypad, not the main keyboard (and not what I'm wanting). Strictly speaking, I'm after Ctrl+= rather than Ctrl++.

Any ideas?

This is on Delphi 10.1 Berlin

Cheers,

Gerald.
Lajos Juhasz

Posts: 801
Registered: 3/14/14
Re: Assigning Keyboard shortcuts Ctrl++ and Ctrl+- to TAction  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 7, 2017 5:31 AM   in response to: Gerald Holdsworth in response to: Gerald Holdsworth
Gerald Holdsworth wrote:

I'm trying to setup a couple of TAction for the keyboard shortcuts
Ctrl++ (for Zoom In) and Ctrl+- (for Zoom out), but entering
'Ctrl++', 'Ctrl+=', or 'Ctrl+-' does not work. However, 'Ctrl+Num +'
and 'Ctrl+Num -' does work...but this is for the keypad, not the main
keyboard (and not what I'm wanting). Strictly speaking, I'm after
Ctrl+= rather than Ctrl++.

Any ideas?

This is on Delphi 10.1 Berlin

Cheers,

Gerald.

I can have Ctrl+= and Ctrl+- as shortcuts:

  object ActionList1: TActionList
    Left = 311
    Top = 155
    object acZoomIn: TAction
      Caption = 'Ctrl + ='
      ShortCut = 16571
      OnExecute = acZoomInExecute
    end
    object acZoolOut: TAction
      Caption = 'CTRL + -'
      ShortCut = 16573
      OnExecute = acZoolOutExecute
    end
  end 


Just to be sure you should also add shortcuts to support Ctrl+Nul + and
Ctrl+ Num - .
Gerald Holdsworth

Posts: 76
Registered: 5/23/12
Re: Assigning Keyboard shortcuts Ctrl++ and Ctrl+- to TAction  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 7, 2017 5:47 AM   in response to: Lajos Juhasz in response to: Lajos Juhasz
Lajos Juhasz wrote:
I can have Ctrl+= and Ctrl+- as shortcuts:

  object ActionList1: TActionList
    Left = 311
    Top = 155
    object acZoomIn: TAction
      Caption = 'Ctrl + ='
      ShortCut = 16571
      OnExecute = acZoomInExecute
    end
    object acZoolOut: TAction
      Caption = 'CTRL + -'
      ShortCut = 16573
      OnExecute = acZoolOutExecute
    end
  end 

So I need to specify programmatically - works for me...just popped in a couple of lines in the FormCreate event handler.


Just to be sure you should also add shortcuts to support Ctrl+Nul + and
Ctrl+ Num - .

Yep - thought about that after I'd posted my question. Couldn't get it working as a Secondary Short Cut, so duplicated the first and changed the primary Short Cut.

Many thanks,

Gerald.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02