| 314 | } |
| 315 | |
| 316 | void KeyboardDisplay::OnKeyPressed(int key, bool isRepeat) |
| 317 | { |
| 318 | if (mEnabled && !isRepeat && mAllowHoverTypingInput) |
| 319 | { |
| 320 | key = KeyToLower(key); |
| 321 | QwertyToPitchResponse res = QwertyToPitchMapping::GetPitchForComputerKey(key); |
| 322 | |
| 323 | if (res.mOctaveShift != 0) |
| 324 | { |
| 325 | int newRootOctave = mRootOctave + res.mOctaveShift; |
| 326 | if (newRootOctave >= 0 && newRootOctave + mNumOctaves < 12) |
| 327 | mRootOctave = newRootOctave; |
| 328 | } |
| 329 | if (res.mPitch != -1) |
| 330 | { |
| 331 | int pitch = res.mPitch + mRootOctave * 12; |
| 332 | mKeyPressRegister[key] = pitch; |
| 333 | PlayNote(NextBufferTime(false), pitch, 127); |
| 334 | } |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | void KeyboardDisplay::KeyReleased(int key) |
| 339 | { |
nothing calls this directly
no test coverage detected