Skip to content

Commit

Permalink
Merge pull request #523 from beru/SetTimer_interval_BugFix
Browse files Browse the repository at this point in the history
キーボードの文字の入力の表示の間隔設定をミリ秒に変換してからタイマーの間隔に使用するように修正
  • Loading branch information
beru committed Oct 7, 2018
2 parents f7fbe34 + 85882f7 commit 463a5b1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sakura_core/view/CEditView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,12 @@ BOOL CEditView::Create(
}

/* キーボードの現在のリピート間隔を取得 */
int nKeyBoardSpeed;
SystemParametersInfo( SPI_GETKEYBOARDSPEED, 0, &nKeyBoardSpeed, 0 );

DWORD dwKeyBoardSpeed;
SystemParametersInfo( SPI_GETKEYBOARDSPEED, 0, &dwKeyBoardSpeed, 0 );
/* リピート速度の設定をミリ秒に変換 */
UINT uElapse = 400 - dwKeyBoardSpeed * (400 - 33) / 31;
/* タイマー起動 */
if( 0 == ::SetTimer( GetHwnd(), IDT_ROLLMOUSE, nKeyBoardSpeed, EditViewTimerProc ) ){
if( 0 == ::SetTimer( GetHwnd(), IDT_ROLLMOUSE, uElapse, EditViewTimerProc ) ){
WarningMessage( GetHwnd(), LS(STR_VIEW_TIMER) );
}

Expand Down

0 comments on commit 463a5b1

Please sign in to comment.