X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FLibCecTray%2Fcontroller%2Fapplications%2FApplicationController.cs;h=ae9a226f26cfba18f7bc84b94ee68404d08ff710;hb=bfea6e0a8ee4bc9e40c64ea68f22db69ac3cb26f;hp=7d0b23d3dc46fca2dc149f7725117a1b53eb4983;hpb=3d15aebf1352c57b6c07b9df63ef189f8dd76e10;p=deb_libcec.git diff --git a/src/LibCecTray/controller/applications/ApplicationController.cs b/src/LibCecTray/controller/applications/ApplicationController.cs index 7d0b23d..ae9a226 100644 --- a/src/LibCecTray/controller/applications/ApplicationController.cs +++ b/src/LibCecTray/controller/applications/ApplicationController.cs @@ -1,7 +1,7 @@ /* * This file is part of the libCEC(R) library. * - * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved. + * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. * libCEC(R) is an original work, containing original code. * * libCEC(R) is a trademark of Pulse-Eight Limited. @@ -114,7 +114,20 @@ namespace LibCECTray.controller.applications var item = args.RowIndex < ButtonConfig.Count ? ButtonConfig[args.RowIndex] : null; if (item == null) return; - (new CecButtonConfigUI(item)).ShowDialog(); + if (args.ColumnIndex >= 0) + { + (new CecButtonConfigUI(item)).ShowDialog(); + } + else + { + var mappedButton = ButtonConfig[item.Key]; + if (mappedButton == null || mappedButton.Value.Empty()) + return; + + var controlWindow = FindInstance(); + if (controlWindow != IntPtr.Zero && item.Key.Duration == 0) + mappedButton.Value.Transmit(controlWindow); + } }; foreach (var item in _buttonConfig) @@ -235,7 +248,7 @@ namespace LibCECTray.controller.applications return false; var controlWindow = FindInstance(); - if (controlWindow != IntPtr.Zero && key.Duration == 0) + if (controlWindow != IntPtr.Zero && (key.Duration == 0 || key.Duration > 500)) return mappedButton.Value.Transmit(controlWindow); return false;