Ejemplo n.º 1
0
        public static List <UInt32> GetPressedKeys()
        {
            UInt32[] keyBuffer = new UInt32[3];
            GCHandle handle    = GCHandle.Alloc(keyBuffer, GCHandleType.Pinned);

            try {
                InputApi.GetPressedKeysWrapper(handle.AddrOfPinnedObject());
            } finally {
                handle.Free();
            }

            List <UInt32> keys = new List <UInt32>();

            for (int i = 0; i < 3; i++)
            {
                if (keyBuffer[i] != 0)
                {
                    keys.Add(keyBuffer[i]);
                }
            }
            return(keys);
        }
Ejemplo n.º 2
0
 public void SetKeyState(int scanCode, bool state)
 {
     SnesInputApi.SetKeyState(scanCode, state);
 }
Ejemplo n.º 3
0
 public static string GetKeyName(UInt32 key)
 {
     return(Utf8Marshaler.PtrToStringUtf8(InputApi.GetKeyNameWrapper(key)));
 }