Recent

Author Topic: crossplatform shortcuts  (Read 2367 times)

apeoperaio

  • Sr. Member
  • ****
  • Posts: 293
crossplatform shortcuts
« on: August 24, 2017, 11:49:14 am »
I am developing a cross platform application. I would like to deploy this app for OS X too.
Since win and linux have comparable shortcuts while OS X has typically different shortcuts (e.g. cmd+G for find next, instead of F3).
What is the simplest way to manage these differences?

Thanks,
Andrea

RAW

  • Hero Member
  • *****
  • Posts: 871
Re: crossplatform shortcuts
« Reply #1 on: August 24, 2017, 03:21:32 pm »
I think I would check IFDEF Mac then OnKeyDown CMD+G do XYZ.. and IFDEF Windows and Linux then OnKeyDown F3 do XYZ... never needed this btw...  :)

apeoperaio

  • Sr. Member
  • ****
  • Posts: 293
Re: crossplatform shortcuts
« Reply #2 on: September 01, 2017, 12:30:11 pm »
I would like to create a unit with all my needed shortcuts (with ifdef).
e.g.

  {$IFDEF DARWIN}
  SC_OPEN = VK_LWIN + VK_O; // command + O
  {$ENDIF}
  SC_OPEN = VK_CONTROL + VK_O;  // control + O

Then I would like to to:
myopenaction.shortcut:= SC_OPEN;

Anyway I am not able to set control + O, what should I assign to SC_OPEN to have control + O?


apeoperaio

  • Sr. Member
  • ****
  • Posts: 293
Re: crossplatform shortcuts
« Reply #3 on: September 01, 2017, 12:47:44 pm »
  SC_OPEN = scCtrl + VK_O;
works for ctrl + O
what about command + O on osx?

apeoperaio

  • Sr. Member
  • ****
  • Posts: 293
Re: crossplatform shortcuts
« Reply #4 on: September 01, 2017, 12:51:01 pm »
Got it.

  {$IFDEF DARWIN}
  SC_OPEN = scMeta + VK_O; // command + O
  {$ENDIF}
  SC_OPEN = scCtrl + VK_O;  // control + O

 

TinyPortal © 2005-2018