Understanding of global hotkeys and events in general


hi!

writing c++ program , want integrate global hotkeys capabilities. there ways implement global hotkeys in objective-c, using ddhotkey or cgeventtap.

setting aside problems of invoking objective-c code c++ code, question quite simple. (using 1 of techniques noted above) after register hotkey , press hotkey, happens next? program suspended , event handler called right away? or call function (whenever want to), calls appropriate handlers if hotkey fired time? program's flow like?

might see, not understand big picture. see pile of code snippets, tell me nothing. very new mac os x development.

credit question: ddhotkey legacy, because it's based on carbon, deprecated?

please, let me kindly ask clarify above points.
 

the general flow not unique osx. believe if not devices since beginning use similar.

first google search result ddhotkey cocoa class: https://github.com/davedelong/ddhotkey. looks still work.

simplest method have program continuously wait input. on every input check against current hotkey definition , jump correct handler or ignore if isn't 1 of chosen hotkeys (or show error). return waiting cycle.

more involved method make program call functions asynchronously, never suspend call handlers based on hotkey.

depends on doing.
 


Forums Macs Mac Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments

Popular posts from this blog

Sean Penn, "Chapo Guzman", and Rolling Stone

Subler - What is "Fix Audio Fallbacks"?

Help please Strange logs