Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Widgetset
»
Cocoa
»
Global hotkey
Free Pascal
Website
Downloads
Wiki
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Bugtracker
IRC channel
Latest SVN
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Force mouse to freeze whe...
by
blankname
[
Today
at 04:53:54 pm]
[SOLVED] ZEOS Change quer...
by
pcurtis
[
Today
at 04:42:29 pm]
Very Weird SIGSEGV
by
rwebb616
[
Today
at 04:41:16 pm]
Contemporary Pascal Discu...
by
Warfley
[
Today
at 04:39:30 pm]
Compiling Linux project t...
by
devEric69
[
Today
at 04:38:02 pm]
Consumir Web Service Segu...
by
FOV_2001
[
Today
at 04:35:37 pm]
Can't install trunk versi...
by
GetMem
[
Today
at 04:23:25 pm]
Fcl-Pdf: showing whole pa...
by
jcmontherock
[
Today
at 03:25:38 pm]
A poll about FPC +/ Lazar...
by
kupferstecher
[
Today
at 03:15:28 pm]
[still there] crash with ...
by
Muso
[
Today
at 03:12:51 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Global hotkey (Read 1041 times)
scribly
Jr. Member
Posts: 77
Global hotkey
«
on:
March 31, 2020, 10:32:25 am »
I'd like to register a hotkey (e.g cmd+alt+Q)" that will do a specific action in my application when pressed, even when my app isn't in the foreground.
Is that possible? I checked out getKeyState but that only gets modifiers
Logged
trev
Global Moderator
Hero Member
Posts: 1386
Former Delphi 1-7, 10.2 User
Re: Global hotkey
«
Reply #1 on:
March 31, 2020, 12:29:56 pm »
This
Apple documentation
may be of help.
Logged
Lazarus 2.1 r65019 FPC 3.3.1 r49223 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.1 r65019 FPC 3.3.1 r49223 macOS 11.2.3 aarch64 Xcode 12.4
Lazarus 2.1 r61574 FPC 3.3.1 r42318 FreeBSD 12.1 amd64 VMware VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 FPC 3.2.0 Win10 Parallels VM
scribly
Jr. Member
Posts: 77
Re: Global hotkey
«
Reply #2 on:
March 31, 2020, 11:49:13 pm »
I managed to get it to work with Install(Application)EventHandler, and RegisterEventHotkey
Logged
trev
Global Moderator
Hero Member
Posts: 1386
Former Delphi 1-7, 10.2 User
Re: Global hotkey
«
Reply #3 on:
April 01, 2020, 02:17:08 am »
I may be wrong, but isn't RegisterEventHotkey from the 32 bit Carbon framework? In which case it will not work after Mojave...
Logged
Lazarus 2.1 r65019 FPC 3.3.1 r49223 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.1 r65019 FPC 3.3.1 r49223 macOS 11.2.3 aarch64 Xcode 12.4
Lazarus 2.1 r61574 FPC 3.3.1 r42318 FreeBSD 12.1 amd64 VMware VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 FPC 3.2.0 Win10 Parallels VM
scribly
Jr. Member
Posts: 77
Re: Global hotkey
«
Reply #4 on:
April 01, 2020, 09:01:24 am »
I'm on catalina and it still works. It's one of the functions that they kept functional in 64-bit
«
Last Edit: April 01, 2020, 09:03:49 am by scribly
»
Logged
trev
Global Moderator
Hero Member
Posts: 1386
Former Delphi 1-7, 10.2 User
Re: Global hotkey
«
Reply #5 on:
April 01, 2020, 12:47:45 pm »
Good to know.
Logged
Lazarus 2.1 r65019 FPC 3.3.1 r49223 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.1 r65019 FPC 3.3.1 r49223 macOS 11.2.3 aarch64 Xcode 12.4
Lazarus 2.1 r61574 FPC 3.3.1 r42318 FreeBSD 12.1 amd64 VMware VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 FPC 3.2.0 Win10 Parallels VM
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Widgetset
»
Cocoa
»
Global hotkey
TinyPortal
© 2005-2018