Set is used for updating whether or not a key is held down, or not held down.
(k Key, state bool)
| 32 | |
| 33 | // Set is used for updating whether or not a key is held down, or not held down. |
| 34 | func (km *KeyManager) Set(k Key, state bool) { |
| 35 | km.mutex.Lock() |
| 36 | |
| 37 | ks := km.mapper[k] |
| 38 | ks.set(state) |
| 39 | km.mapper[k] = ks |
| 40 | km.dirtmap[k] = k |
| 41 | |
| 42 | km.mutex.Unlock() |
| 43 | } |
| 44 | |
| 45 | // Get retrieves a keys state. |
| 46 | func (km *KeyManager) Get(k Key) KeyState { |