示例#1
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();
     }
 }
 // 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();
     }
 }
示例#3
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();
        }