Skip to content

Commit

Permalink
レビュー指摘対応
Browse files Browse the repository at this point in the history
  • Loading branch information
beru committed Oct 7, 2018
1 parent 8927c9b commit 83458a2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sakura_core/view/CEditView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,15 @@ BOOL CEditView::Create(

/* キーボードの現在のリピート間隔を取得 */
DWORD dwKeyBoardSpeed;
constexpr DWORD keyboardRepeatSpeedMax = 31;
constexpr DWORD keyboardRepeatSpeedMax = 31; // 0~31の範囲の最大値
if( SystemParametersInfo( SPI_GETKEYBOARDSPEED, 0, &dwKeyBoardSpeed, 0 ) ){
// 念の為に assert で確認
assert(dwKeyBoardSpeed <= keyboardRepeatSpeedMax);
}
else{
dwKeyBoardSpeed = keyboardRepeatSpeedMax;
// SystemParametersInfo の呼び出しが失敗した場合は最大値をデフォルト値として設定
constexpr DWORD keyboardRepeatSpeedDefault = keyboardRepeatSpeedMax;
dwKeyBoardSpeed = keyboardRepeatSpeedDefault;
}
/* リピート速度の設定をミリ秒に変換 */
UINT uElapse = 400 - dwKeyBoardSpeed * (400 - 33) / keyboardRepeatSpeedMax;
Expand Down

0 comments on commit 83458a2

Please sign in to comment.