コード例 #1
0
 /// <summary>
 /// Инициализация хитрожопых клавиш Logitech устройств
 /// </summary>
 public static void InitLogitechKeyboard(LogitechKeyProcessor KeyProc)
 {
     //-- Назначаем внутренней переменной фунекцию обработчик нажатий клавиш
     keyProcess = KeyProc ?? throw new ArgumentNullException("При инициализации класса LogitechKeyboard необходимо задавать функцию-обработчик.");
     cblnstance = new LogitechGSDK.logiGkeyCB(GkeySDKCallback);
     LogitechGSDK.LogiGkeyInitWithoutContext(cblnstance);
 }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     //Value used to show the two different ways to implement g-keys support in your game
     //change it to false to try the non-callback version
     usingCallback = true;
     if (usingCallback){
         LogitechGSDK.logiGkeyCB cbInstance = new LogitechGSDK.logiGkeyCB(this.GkeySDKCallback);
         LogitechGSDK.LogiGkeyInitWithoutContext(cbInstance);
     }
     else
         LogitechGSDK.LogiGkeyInitWithoutCallback();
 }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     //Value used to show the two different ways to implement g-keys support in your game
     //change it to false to try the non-callback version
     usingCallback = true;
     if (usingCallback)
     {
         LogitechGSDK.logiGkeyCB cbInstance = new LogitechGSDK.logiGkeyCB(this.GkeySDKCallback);
         LogitechGSDK.LogiGkeyInitWithoutContext(cbInstance);
     }
     else
     {
         LogitechGSDK.LogiGkeyInitWithoutCallback();
     }
 }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     descriptionLabel = "Last g-key event : ";
     lastKeyPress     = "No g-key event";
     //Value used to show the two different ways to implement g-keys support in your game
     //change it to false to try the non-callback version
     if (usingCallback)
     {
         LogitechGSDK.logiGKeyCbContext cbContext;
         LogitechGSDK.logiGkeyCB        cbInstance = new LogitechGSDK.logiGkeyCB(this.GkeySDKCallback);
         cbContext.gkeyCallBack = cbInstance;
         cbContext.gkeyContext  = IntPtr.Zero;
         LogitechGSDK.LogiGkeyInit(ref cbContext);
     }
     else
     {
         LogitechGSDK.LogiGkeyInitWithoutCallback();
     }
 }
コード例 #5
0
        public Sync()
        {
            InitializeComponent();
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

            //Value	used	to	show	the	two	different	ways	to	implement	g-keys	support	in	your	game
            //change	it	to	false	to	try	the	non-callback	version
            usingCallback = true; //or	false,	depending	on	your	implementation
            if (usingCallback)
            {
                cbInstance = new LogitechGSDK.logiGkeyCB(this.GkeySDKCallback);
                LogitechGSDK.LogiGkeyInitWithoutContext(cbInstance);
            }
            else
            {
                LogitechGSDK.LogiGkeyInitWithoutCallback();
            }

            timer1.Start();
        }