![]() |
Hauppauge Fernbedienung benutzen IrRemote.ini
Hallo!
Ich möchte hier mal einen Quellcode frei geben, den ich geschrieben habe um fernbedienung-befehle von Hauppauge an ein DelphiProject weiter zu leiten.
Delphi-Quellcode:
Damit eure Fernbedienung auch die richtigen Commands an euer Programm weiter leitet müsst ihr noch folgendes in die IrRemote.ini einfügen.unit IrRemote; interface uses Windows, Messages, SysUtils, Forms; type TRemoteKeyEvent = class(TForm) private { Private-Deklarationen } public { Public-Deklarationen } procedure WmCommand(var Msg: TMessage); message WM_COMMAND; end; const IR_GO = 10; IR_GRNPOWER = 11; IR_TVNEW = 20; IR_VIDEOS = 21; IR_MUSIC = 22; IR_PICTURES = 23; IR_GUIDE = 24; IR_RADIO = 25; IR_OK = 30; IR_NAVUP = 31; IR_NAVDOWN = 32; IR_NAVLEFT = 33; IR_NAVRIGHT = 34; IR_BACK = 40; IR_MENU = 41; IR_CHNLPREV = 42; IR_MUTE = 43; IR_VOLUP = 50; IR_VOLDOWN = 51; IR_CHNLUP = 52; IR_CHNLDOWN = 53; IR_REC = 60; IR_STOP = 61; IR_REWIND = 62; IR_PLAY = 63; IR_FASTFWD = 64; IR_SKIPREV = 65; IR_PAUSE = 66; IR_SKIPFWD = 67; IR_0 = 70; IR_1 = 71; IR_2 = 72; IR_3 = 73; IR_4 = 74; IR_5 = 75; IR_6 = 76; IR_7 = 77; IR_8 = 78; IR_9 = 79; IR_TEXT = 80; IR_SUBCC = 81; IR_RED = 90; IR_GREEN = 91; IR_YELLOW = 92; IR_BLUE = 93; var RemoteKeyEvent: TRemoteKeyEvent; implementation {$R *.dfm} function IrCommandPossible(Msg: TMessage): Boolean; const IR_PARAM = 273; // muss eventuell angepasst werden // Besteht aus Msg.Msg begin Result := ( (Msg.Msg = IR_PARAM) and // evtl. löschen wenn sonst nicht geht (Msg.LParam = 0) and (Msg.WParam > 9) and (Msg.WParam < 100) ); end; procedure TRemoteKeyEvent.WmCommand(var Msg: TMessage); var RemoteKey: Byte; begin if IrCommandPossible(Msg) then begin RemoteKey := Msg.WParam; {Hier Quellcode einfügen} {Insert Quellcode here} Case RemoteKey of IR_VIDEOS : {procedure/Command}; IR_GRNPOWER : {procedure/Command}; {...} end; {Hier Quellcode Ende} {Stop Insering Quellcode} end; end; end. die sollte sich unter "C:\Windows\IrRemote.ini" befinden. Bei den Tasten, die an euer Programm weiter geleitet werden sollen müsst ihr das Semikolon vorher entfernen.
Code:
[Programmname]
;GO={cmd(10)} ;GRNPOWER={cmd(11)} ; ;TVNEW={cmd(20)} ;VIDEOS={cmd(21)} ;MUSIC={cmd(22)} ;PICTURES={cmd(23)} ;GUIDE={cmd(24)} ;RADIO={cmd(25)} ; ;OK={cmd(30)} ;NAVUP={cmd(31)} ;NAVDOWN={cmd(32)} ;NAVLEFT={cmd(33)} ;NAVRIGHT={cmd(34)} ; ;BACK={cmd(40)} ;MENU={cmd(41)} ;CHNLPREV={cmd(42)} ;MUTE={cmd(43)} ; ;VOLUP={cmd(50)} ;VOLDOWN={cmd(51)} ;CHNLUP={cmd(52)} ;CHNLDOWN={cmd(53)} ; ;REC={cmd(60)} ;STOP={cmd(61)} ;REWIND={cmd(62)} ;PLAY={cmd(63)} ;FASTFWD={cmd(64)} ;SKIPREV={cmd(65)} ;PAUSE={cmd(66)} ;SKIPFWD={cmd(67)} ; ;0={cmd(70)} ;1={cmd(71)} ;2={cmd(72)} ;3={cmd(73)} ;4={cmd(74)} ;5={cmd(75)} ;6={cmd(76)} ;7={cmd(77)} ;8={cmd(78)} ;9={cmd(79)} ; ;TEXT={cmd(80)} ;SUBCC={cmd(81)} ; ;RED={cmd(90)} ;GREEN={cmd(91)} ;YELLOW={cmd(92)} ;BLUE={cmd(93)} WICHTIG: Damit die Fernbedienung die befehle sendet, muss euer DelphiProject (bzw. Die Form) im Vordergrund sein. Viel Spass mit dem Quellcode Bei Fragen stehe ich gerne zur Verfügung |
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:40 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz