Tools, languages, libraries and API's for development of a MacOS wide application [closed]

  1. No, there is no public API for these events on macOS. The programming language does not matter.
  2. Yes. Using the Accessibility frameworks. The programming language does not matter.
  3. Swift is Apple's recommended development language for macOS. Discussions about Swift are better answered elsewhere.
  4. See above.
  5. Within your own application, yes this is possible. Sections of windows can be transparent. This is possible in Objective-C or Swift but not in AppleScript. See xScope as an example of display wide overlays.