Ejemplo n.º 1
0
			internal KeyInfo(Scancode Key, SDL1_Keycode storage, string Name, string Description) {
				this.Scancode = Key;
				this.Name = Name;
				this.Description = Description;
				this.StorageCode = (int)storage;
			}
Ejemplo n.º 2
0
 private bool KeyReleased(SDL2.SDL.SDL_Scancode scanCode)
 {
     return(CurrentKeys[(int)scanCode] == 0 && PreviousKeys[(int)scanCode] == 1);
 }
Ejemplo n.º 3
0
		/// <summary>
		/// Looks up the Keycode for a Scancode in Keys array
		/// </summary>
		/// <returns>Corresponding Keycode or Keycode.SDLK_UNKNOWN</returns>
		/// <param name="value">The scancode for search.</param>
		private static int LookupScancode(Scancode value){
			for(int k = 0; k < Keys.Length; k++){
				int i;
				if ((k & 1) == 0) {
					i = (currentIndex + (k >> 1) + Keys.Length) % Keys.Length;
				} else {
					i = (currentIndex - (k + 1 >> 1) + Keys.Length) % Keys.Length;
				}
				if (Keys[i].Scancode == value) {
					currentIndex = (i + 1) % Keys.Length;
					return Keys[i].StorageCode;
				}
			}
			return (int)SDL1_Keycode.SDLK_UNKNOWN;
		}