Пример #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);
        }
Пример #2
0
 public void SetKeyState(int scanCode, bool state)
 {
     SnesInputApi.SetKeyState(scanCode, state);
 }
Пример #3
0
 public static string GetKeyName(UInt32 key)
 {
     return(Utf8Marshaler.PtrToStringUtf8(InputApi.GetKeyNameWrapper(key)));
 }