How can I handle a keyboard shortcut when my program isn't active?

后端 未结 3 1267
走了就别回头了
走了就别回头了 2021-01-06 11:44

Is it ok if i use it like this..for multiple events?

unit Unit4;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms         


        
3条回答
  •  囚心锁ツ
    2021-01-06 12:18

    As others suggested, it's RegisterHotKey function. However, proper implementation of the application that you want to design requires keyboard hook and DLL injection into the application.

    I would recommend that you take a look at TypePilot application. It lets you type or copy/paste any text with certain shortcuts that you type. Eg. you can type "thnk " and this will be replaced with "thank you" by the application.

提交回复
热议问题