本文整理汇总了C++中GET_WHEEL_DELTA_WPARAM函数的典型用法代码示例。如果您正苦于以下问题:C++ GET_WHEEL_DELTA_WPARAM函数的具体用法?C++ GET_WHEEL_DELTA_WPARAM怎么用?C++ GET_WHEEL_DELTA_WPARAM使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GET_WHEEL_DELTA_WPARAM函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: WndProc
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_SYSKEYDOWN:
{
if (wParam == VK_MENU)//ignore left alt stop
{
}
else
return DefWindowProc(hwnd, msg, wParam, lParam); // this makes ALT+F4 work
break;
}
case WM_CLOSE:
{
ShowWindow(hwnd, false);
PostQuitMessage(0);
break;
}
case WM_COMMAND:
break;
case WM_MOUSEWHEEL:
{
win32mouse->SetMouseWheel(GET_WHEEL_DELTA_WPARAM(wParam));
break;
}
case WM_INPUT:
{
UINT dwSize = 48; // 48 for 64bit build
static BYTE lpb[48];
GetRawInputData((HRAWINPUT)lParam, RID_INPUT,
lpb, &dwSize, sizeof(RAWINPUTHEADER)); // this gets relative coords
RAWINPUT* raw = (RAWINPUT*)lpb;
if (raw->header.dwType == RIM_TYPEMOUSE)
{
int xPosRelative = raw->data.mouse.lLastX;
int yPosRelative = raw->data.mouse.lLastY;
win32mouse->SetCursorDeltaRaw(xPosRelative, yPosRelative);
}
break;
}
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
开发者ID:MaciejSzpakowski,项目名称:viva,代码行数:49,代码来源:win32_window.cpp
示例2: MsgProc
//-----------------------------------------------------------------------------
// Name: MsgProc()
// Desc: The window's message handler
//-----------------------------------------------------------------------------
LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch( msg )
{
case WM_DESTROY:
PostQuitMessage( 0 );
break;
case WM_SETCURSOR:
CGameInput::getSingletonPtr()->SetCursorIcon();
break;
case WM_CHAR:
printf( "WM_CHAR\n" );
CGameInput::getSingletonPtr()->InJectChar( wParam );
break;
case WM_KEYDOWN:
printf( "WM_KEYDOWN\n" );
CGameInput::getSingletonPtr()->KeyDown( wParam, lParam );
break;
case WM_KEYUP:
printf( "WM_KEYUP\n" );
CGameInput::getSingletonPtr()->KeyUp( wParam, lParam );
break;
case WM_LBUTTONDOWN:
case WM_LBUTTONDBLCLK:
CGameInput::getSingletonPtr()->SetMouseLBtn(0);
break;
case WM_LBUTTONUP:
CGameInput::getSingletonPtr()->SetMouseLBtn(1);
break;
case WM_RBUTTONDOWN:
CGameInput::getSingletonPtr()->SetMouseRBtn(0);
break;
case WM_RBUTTONUP:
CGameInput::getSingletonPtr()->SetMouseRBtn(1);
break;
case WM_MOUSEMOVE:
CGameInput::getSingletonPtr()->MouseMove( (int)LOWORD( lParam ), (int)HIWORD( lParam ) );
break;
case WM_MOUSEWHEEL:
CGameInput::getSingletonPtr()->SetMouseWheel( GET_WHEEL_DELTA_WPARAM( wParam ) );
break;
case WM_MOVE:
g_iWinX = (int)(short) LOWORD(lParam); // horizontal position
g_iWinY = (int)(short) HIWORD(lParam); // vertical position
break;
}
return DefWindowProc( hWnd, msg, wParam, lParam );
}
开发者ID:JuWell,项目名称:CCC,代码行数:53,代码来源:WinApp.cpp
示例3: GET_WHEEL_DELTA_WPARAM
LRESULT HubMessageControl::onMouseWheel(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
m_wheelAccumulator += GET_WHEEL_DELTA_WPARAM(wParam);
while (abs(m_wheelAccumulator) >= WHEEL_DELTA) {
const bool isNeg = m_wheelAccumulator < 0;
m_wheelAccumulator = abs(m_wheelAccumulator) - WHEEL_DELTA;
if (isNeg) {
if (m_wheelAccumulator != 0) m_wheelAccumulator = -m_wheelAccumulator;
SendMessage(WM_VSCROLL, SB_LINEDOWN);
}
else {
SendMessage(WM_VSCROLL, SB_LINEUP);
}
}
return 0;
}
开发者ID:inetra,项目名称:peers1,代码行数:15,代码来源:HubMessageControl.cpp
示例4: switch
LRESULT CDangleWindowHex::DangleProc(UINT Msg,WPARAM wParam,LPARAM lParam)
{
//выбор по сообщению
switch(Msg)
{
case WM_KEYDOWN:
return OnKey(wParam),0;
case WM_COMMAND:
return OnCommand(LOWORD(wParam),HIWORD(wParam),(HWND)lParam),0;
case WM_MOUSEWHEEL:
return OnMouseWheel(GET_WHEEL_DELTA_WPARAM(wParam)/WHEEL_DELTA,GET_KEYSTATE_WPARAM(wParam)),0;
default:
return DefWindowProc(mhWindow,Msg,wParam,lParam);
}
}
开发者ID:revel8n,项目名称:code0,代码行数:15,代码来源:danglewindow_hex.cpp
示例5: UPDOWN_MouseWheel
/***********************************************************************
* UPDOWN_MouseWheel
*
* Handle mouse wheel scrolling
*/
static LRESULT UPDOWN_MouseWheel(UPDOWN_INFO *infoPtr, WPARAM wParam)
{
int iWheelDelta = GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA;
if (wParam & (MK_SHIFT | MK_CONTROL))
return 0;
if (iWheelDelta != 0)
{
UPDOWN_GetBuddyInt(infoPtr);
UPDOWN_DoAction(infoPtr, abs(iWheelDelta), iWheelDelta > 0 ? FLAG_INCR : FLAG_DECR);
}
return 1;
}
开发者ID:devyn,项目名称:wine,代码行数:20,代码来源:updown.c
示例6: GET_WHEEL_DELTA_WPARAM
void CGameMain::OnMouseWheel(const WPARAM& wParam, const LPARAM& lParam){
int delta = GET_WHEEL_DELTA_WPARAM(wParam);
eMouseKeyStateMask keyState = (eMouseKeyStateMask)GET_KEYSTATE_WPARAM(wParam);
///// 鼠标所在的屏幕坐标
int x = GET_X_LPARAM(lParam);
int y = GET_Y_LPARAM(lParam); //WHEEL_DELTA
static POINT pos;
pos.x = x;
pos.y = y;
::ScreenToClient(g_hWnd, &pos); ////--> 转化为客户区坐标
//printf("OnMouseWheel %d %d (%d,%d) (%d,%d) \n", delta, keyState, x, y, pos.x, pos.y);
_gui.OnMouseWheel(x, y, delta, keyState);
}
开发者ID:Riven2Exile,项目名称:TestDX,代码行数:15,代码来源:GameMain.cpp
示例7: switch
bool ExScrollBar::isPressed(unsigned int Sender, WPARAM wParam)
{
if (cState == INVISIBLE) return false;
switch (Sender) {
case WM_KEYDOWN:
{
switch (wParam)
{
case VK_UP: {if (*sValue > sMin) { *sValue = *sValue - 1; Update(); } return true; }
case VK_DOWN: {if (*sValue<sMax) { *sValue = *sValue + 1; Update(); } return true; }
case VK_PRIOR:{if (*sValue >= sMin + 5) { *sValue = *sValue - 5; Update(); } else if (*sValue>sMin) { *sValue = sMin; Update(); } return true; } /*PGUP*/
case VK_NEXT: {if (*sValue <= sMax - 5) { *sValue = *sValue + 5; Update(); } else if (*sValue<sMax) { *sValue = sMax; Update(); } return true; } /*PGDN*/
case VK_HOME: {if (*sValue>sMin) { *sValue = sMin; Update(); } return true; }
case VK_END: {if (*sValue<sMax) { *sValue = sMax; Update(); } return true; }
}
}
case WM_MOUSEWHEEL:
{
if (GET_WHEEL_DELTA_WPARAM(wParam)>0) { if (*sValue > sMin) { *sValue = *sValue - 1; Update(); } return true; }
else if (GET_WHEEL_DELTA_WPARAM(wParam) < 0) { if (*sValue < sMax) { *sValue = *sValue + 1; Update(); } return true; }
}
}
return false;
}
开发者ID:Marmeladenbrot,项目名称:D2Ex2,代码行数:24,代码来源:ExScrollBar.cpp
示例8: TwEventWin
LRESULT CALLBACK Window::WindowProc(HWND Handle, unsigned int msg, WPARAM wParam, LPARAM lParam)
{
TwEventWin(Handle,msg,wParam,lParam);
switch (msg)
{
case WM_SYSCOMMAND:
{
if (wParam == SC_CLOSE)
{
PostMessage(Handle,WM_DESTROY,0,0);
}
break;
}
case WM_DESTROY:
{
PostQuitMessage(0);
break;
}
case WM_MOUSEWHEEL:
{
if(lcMouse::Get())
lcMouse::Get()->m_uiScrollVal = GET_WHEEL_DELTA_WPARAM(wParam);
break;
}
case WM_DROPFILES:
{
HDROP hDrop = (HDROP)wParam;
int iFileCount = DragQueryFile(hDrop,0xFFFFFFFF, nullptr, MAX_PATH);
for(int i = 0;i < iFileCount;++i)
{
char a_szFileDir[256];
DragQueryFile(hDrop,i,a_szFileDir,MAX_PATH);
m_pSingleton->OnDropFile(a_szFileDir);
}
DragFinish(hDrop);
break;
}
default:
return DefWindowProc(Handle,msg,wParam,lParam);
};
return 0;
}
开发者ID:NathanChambers,项目名称:Labyrinth-Engine,代码行数:48,代码来源:lcWindow.cpp
示例9: switch
void customize_Scene::WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam)
{
switch (iMessage)
{
case WM_MOUSEWHEEL:
Z -= (GET_WHEEL_DELTA_WPARAM(wParam) / 100);
if (Z < 0.5)
Z = 0.5f;
if (Z > 10)
Z = 10;
break;
}
}
开发者ID:tkc12000,项目名称:HYKS,代码行数:16,代码来源:customize_Scene.cpp
示例10: GET_WHEEL_DELTA_WPARAM
void CDataScope::OnMouseWheel(WPARAM wParam, LPARAM lParam)
{
INT nValue = GET_WHEEL_DELTA_WPARAM(wParam);
// Update scroll info
if (nValue > 0)
{
m_fXScale *= 0.9;
}
else
{
m_fXScale /= 0.9;
}
InvalidateRect(m_hWnd, NULL, TRUE);
}
开发者ID:neuks,项目名称:Synaptics,代码行数:16,代码来源:CDataScope.cpp
示例11: CursorEvent
void WinInputManager::Run(UINT const & msg, WPARAM wParam, LPARAM lParam)
{
if (m_listenerList.empty())
return;
eKeyCodes KeyIndex;
wchar_t buffer[1];
BYTE lpKeyState[256];
CursorEvent();
switch (msg)
{
case WM_KEYDOWN:
KeyIndex = static_cast<eKeyCodes>(wParam);
GetKeyboardState(lpKeyState);
ToUnicode(wParam, HIWORD(lParam) & 0xFF, lpKeyState, buffer, 1, 0);
KeyEvent(KeyIndex, buffer[0], true);
break;
case WM_KEYUP:
KeyIndex = static_cast<eKeyCodes>(wParam);
GetKeyboardState(lpKeyState);
ToUnicode(wParam, HIWORD(lParam) & 0xFF, lpKeyState, buffer, 1, 0);
KeyEvent(KeyIndex, buffer[0], false);
break;
case WM_LBUTTONDOWN:
MouseEvent(MOUSE_LEFT, true);
break;
case WM_LBUTTONUP:
MouseEvent(MOUSE_LEFT, false);
break;
case WM_RBUTTONDOWN:
MouseEvent(MOUSE_RIGHT, true);
break;
case WM_RBUTTONUP:
MouseEvent(MOUSE_RIGHT, false);
break;
case WM_MBUTTONDOWN:
MouseEvent(MOUSE_MIDDLE, true);
break;
case WM_MBUTTONUP:
MouseEvent(MOUSE_MIDDLE, false);
break;
case WM_MOUSEWHEEL:
MouseWheelEvent((short)GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA);
break;
}
}
开发者ID:antxxx18,项目名称:TyphoonEngine,代码行数:47,代码来源:WinInputManager.cpp
示例12: switch
VOID CInputManager::MessageProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
//滚轮消息
case WM_MOUSEWHEEL:
{
if(GET_WHEEL_DELTA_WPARAM(wParam)>0)
{
m_dwMouseFlag |= MOUSE_WHEELUP;
}
else
{
m_dwMouseFlag |= MOUSE_WHEELDOWN;
}
}
break;
//键盘按下
case WM_KEYDOWN:
{
//用来处理重复的键盘按下
m_Buf_WM_KEYDOWN = std::make_pair(wParam, lParam);
m_bCatchKeyDown = true;
// AxTrace(0, 2, "Push:%d", wParam);
}
break;
//鼠标
case WM_LBUTTONDBLCLK:
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
case WM_MOUSEMOVE:
{
m_ptMouseNow.x = GET_X_LPARAM(lParam);
m_ptMouseNow.y = GET_Y_LPARAM(lParam);
}
break;
//文字输入
case WM_CHAR:
case WM_IME_COMPOSITION:
CGameProcedure::s_pUISystem_->InjectInput_CHAR(hWnd, message, wParam, lParam);
break;
}
}
开发者ID:brock7,项目名称:TianLong,代码行数:47,代码来源:InputManager.cpp
示例13: ImGui_ImplDX10_WndProcHandler
IMGUI_API LRESULT ImGui_ImplDX10_WndProcHandler(HWND, UINT msg, WPARAM wParam, LPARAM lParam)
{
ImGuiIO& io = ImGui::GetIO();
switch (msg)
{
case WM_LBUTTONDOWN:
io.MouseDown[0] = true;
return true;
case WM_LBUTTONUP:
io.MouseDown[0] = false;
return true;
case WM_RBUTTONDOWN:
io.MouseDown[1] = true;
return true;
case WM_RBUTTONUP:
io.MouseDown[1] = false;
return true;
case WM_MBUTTONDOWN:
io.MouseDown[2] = true;
return true;
case WM_MBUTTONUP:
io.MouseDown[2] = false;
return true;
case WM_MOUSEWHEEL:
io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f;
return true;
case WM_MOUSEMOVE:
io.MousePos.x = (signed short)(lParam);
io.MousePos.y = (signed short)(lParam >> 16);
return true;
case WM_KEYDOWN:
if (wParam < 256)
io.KeysDown[wParam] = 1;
return true;
case WM_KEYUP:
if (wParam < 256)
io.KeysDown[wParam] = 0;
return true;
case WM_CHAR:
// You can also use ToAscii()+GetKeyboardState() to retrieve characters.
if (wParam > 0 && wParam < 0x10000)
io.AddInputCharacter((unsigned short)wParam);
return true;
}
return 0;
}
开发者ID:4ker,项目名称:imgui,代码行数:46,代码来源:imgui_impl_dx10.cpp
示例14: HandleMouseScrollEvents
void HandleMouseScrollEvents(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LPSCROLLSTATE state)
{
SCROLLINFO si;
int Delta;
int NewPos;
si.cbSize = sizeof(si);
si.fMask = SIF_PAGE;
GetScrollInfo(hWnd, SB_VERT, &si);
if (Globals.uLinesToScroll == WHEEL_PAGESCROLL)
{
NewPos = si.nPage;
}
else
{
NewPos = Globals.uLinesToScroll * 5;
}
if (GET_WHEEL_DELTA_WPARAM(wParam) > 0)
{
NewPos = state->CurrentY - NewPos;
}
else
{
NewPos = state->CurrentY + NewPos;
}
NewPos = min(state->MaxY, max(0, NewPos));
if (NewPos == state->CurrentY)
{
return;
}
Delta = NewPos - state->CurrentY;
state->CurrentY = NewPos;
ScrollWindowEx(hWnd, 0, -Delta, NULL, NULL, NULL, NULL, SW_INVALIDATE);
si.cbSize = sizeof(si);
si.fMask = SIF_POS;
si.nPos = state->CurrentY;
SetScrollInfo(hWnd, SB_VERT, &si, TRUE);
}
开发者ID:GYGit,项目名称:reactos,代码行数:46,代码来源:scrollutils.c
示例15: GET_WHEEL_DELTA_WPARAM
BOOL CMouseWheelMgr::OnMouseEx(UINT uMouseMsg, const MOUSEHOOKSTRUCTEX& info)
{
if (uMouseMsg == WM_MOUSEWHEEL)
{
HWND hwndPt = ::WindowFromPoint(info.pt);
int zDelta = GET_WHEEL_DELTA_WPARAM(info.mouseData);
if (info.hwnd != hwndPt) // does the window under the mouse have the focus.
{
// modifier keys are not reported in MOUSEHOOKSTRUCTEX
// so we have to figure them out
WORD wKeys = 0;
if (GetKeyState(VK_CONTROL) & 0x8000)
wKeys |= MK_CONTROL;
if (GetKeyState(VK_SHIFT) & 0x8000)
wKeys |= MK_SHIFT;
if (GetKeyState(VK_LBUTTON) & 0x8000)
wKeys |= MK_LBUTTON;
if (GetKeyState(VK_RBUTTON) & 0x8000)
wKeys |= MK_RBUTTON;
if (GetKeyState(VK_MBUTTON) & 0x8000)
wKeys |= MK_MBUTTON;
::PostMessage(hwndPt, WM_MOUSEWHEEL, MAKEWPARAM(wKeys, zDelta), MAKELPARAM(info.pt.x, info.pt.y));
return TRUE; // eat
}
else // special cases not natively supporting mouse wheel
{
CString sClass = CWinClasses::GetClass(hwndPt);
if (CWinClasses::IsClass(sClass, WC_DATETIMEPICK) ||
CWinClasses::IsClass(sClass, WC_MONTHCAL))
{
::PostMessage(hwndPt, WM_KEYDOWN, zDelta > 0 ? VK_UP : VK_DOWN, 0L);
}
}
}
// all else
return FALSE;
}
开发者ID:jithuin,项目名称:infogeezer,代码行数:46,代码来源:MouseWheelMgr.cpp
示例16: switch
/*************************************************************//**
*
* @brief 送信されたメッセージの処理を行う
* @param ウィンドウハンドル
* @param メッセージ
* @param メッセージの付加情報
* @param メッセージの付加情報
* @return メッセージ処理の結果
*
****************************************************************/
LRESULT CALLBACK C_MainWindow::LocalWindowProcedure(HWND pWindowHandle,
UINT message,
WPARAM wParameter,
LPARAM lParameter)
{
// ウィンドウのクライアント領域を描画するときに使うことのできる情報
PAINTSTRUCT paintStruct;
// デバイスコンテキストハンドル
HDC deviceContextHandle = nullptr;
// 送られてきたメッセージにより各種処理を行う
switch (message)
{
/* マウスホイールを回転した場合 */
case WM_MOUSEWHEEL:
// 回転量を設定
C_InputManager::s_GetInstance()->SetMouseWheelRotation(GET_WHEEL_DELTA_WPARAM(wParameter) / WHEEL_DELTA);
break;
/* 無効領域が発生した場合 */
case WM_PAINT:
// 指定されたウィンドウに対して描画の準備
deviceContextHandle = ::BeginPaint(pWindowHandle, &paintStruct);
// 指定されたウィンドウ内の描画の終わりを示す
::EndPaint(pWindowHandle, &paintStruct);
break;
/* ウィンドウが破棄される場合 */
case WM_DESTROY:
// アプリケーションの終了コードを指定
::PostQuitMessage(0);
// 終了フラグを立てる
C_BaseWindow::s_SetFinishFlag(true);
break;
}
// メッセージ処理の結果を返す
return DefWindowProc(pWindowHandle, message, wParameter, lParameter);
}
开发者ID:risaki-masa,项目名称:DirectX_Framework,代码行数:56,代码来源:MainWindow.cpp
示例17: onMouseWheel
LRESULT WebPopupMenuProxyWin::onMouseWheel(HWND hWnd, UINT message, WPARAM wParam, LPARAM, bool& handled)
{
handled = true;
if (!scrollbar())
return 0;
int i = 0;
for (incrementWheelDelta(GET_WHEEL_DELTA_WPARAM(wParam)); abs(wheelDelta()) >= WHEEL_DELTA; reduceWheelDelta(WHEEL_DELTA)) {
if (wheelDelta() > 0)
++i;
else
--i;
}
ScrollableArea::scroll(i > 0 ? ScrollUp : ScrollDown, ScrollByLine, abs(i));
return 0;
}
开发者ID:ACSOP,项目名称:android_external_webkit,代码行数:18,代码来源:WebPopupMenuProxyWin.cpp
示例18: PlatformEvent
PlatformWheelEvent::PlatformWheelEvent(HWND hWnd, WPARAM wParam, LPARAM lParam, bool isMouseHWheel)
: PlatformEvent(PlatformEvent::Wheel, wParam & MK_SHIFT, wParam & MK_CONTROL, GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT, GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT, ::GetTickCount() * 0.001)
, m_position(positionForEvent(hWnd, lParam))
, m_globalPosition(globalPositionForEvent(hWnd, lParam))
, m_directionInvertedFromDevice(false)
{
float scaleFactor = deviceScaleFactorForWindow(hWnd);
// How many pixels should we scroll per line? Gecko uses the height of the
// current line, which means scroll distance changes as you go through the
// page or go to different pages. IE 7 is ~50 px/line, although the value
// seems to vary slightly by page and zoom level. Since IE 7 has a
// smoothing algorithm on scrolling, it can get away with slightly larger
// scroll values without feeling jerky. Here we use 100 px per three lines
// (the default scroll amount on Windows is three lines per wheel tick).
static const float cScrollbarPixelsPerLine = scaleFactor * 100.0f / 3.0f;
float delta = GET_WHEEL_DELTA_WPARAM(wParam) / (scaleFactor * static_cast<float>(WHEEL_DELTA));
if (isMouseHWheel) {
// Windows is <-- -/+ -->, WebKit wants <-- +/- -->, so we negate
// |delta| after saving the original value on the wheel tick member.
m_wheelTicksX = delta;
m_wheelTicksY = 0;
delta = -delta;
} else {
// Even though we use shift + vertical wheel to scroll horizontally in
// WebKit, we still note it as a vertical scroll on the wheel tick
// member, so that the DOM event we later construct will match the real
// hardware event better.
m_wheelTicksX = 0;
m_wheelTicksY = delta;
}
if (isMouseHWheel || shiftKey()) {
m_deltaX = delta * static_cast<float>(horizontalScrollChars()) * cScrollbarPixelsPerLine;
m_deltaY = 0;
m_granularity = ScrollByPixelWheelEvent;
} else {
m_deltaX = 0;
m_deltaY = delta;
int verticalMultiplier = verticalScrollLines();
m_granularity = (verticalMultiplier == WHEEL_PAGESCROLL) ? ScrollByPageWheelEvent : ScrollByPixelWheelEvent;
if (m_granularity == ScrollByPixelWheelEvent)
m_deltaY *= static_cast<float>(verticalMultiplier) * cScrollbarPixelsPerLine;
}
}
开发者ID:nickooms,项目名称:webkit,代码行数:44,代码来源:WheelEventWin.cpp
示例19: WindowProc
LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam,
LPARAM lParam)
{
switch(message)
{
case WM_MOUSEWHEEL:
{
int clicks = GET_WHEEL_DELTA_WPARAM(wParam);
float end_value = scale->GetEndValue();
end_value *= pow(0.9, clicks/120);
scale->Interrupt(end_value, 500);
} break;
case WM_KEYDOWN:
{
if(wParam == VK_LEFT)
{
float x_value = X->GetEndValue() - scale->GetValue() / 10;
X->Interrupt(x_value, 500);
}
if(wParam == VK_RIGHT)
{
float x_value = X->GetEndValue() + scale->GetValue() / 10;
X->Interrupt(x_value, 500);
}
if(wParam == VK_UP)
{
float y_value = Y->GetEndValue() + scale->GetValue() / 10;
Y->Interrupt(y_value, 500);
}
if(wParam == VK_DOWN)
{
float y_value = Y->GetEndValue() - scale->GetValue() / 10;
Y->Interrupt(y_value, 500);
}
} break;
case WM_DESTROY:
{
PostQuitMessage(0);
return 0;
} break;
}
return DefWindowProc (hWnd, message, wParam, lParam);
}
开发者ID:Quantumplation,项目名称:Mandelbrot-Explorer,代码行数:44,代码来源:entry.cpp
示例20: switch
LRESULT Camera::CameraInputProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch ( message )
{
case WM_RBUTTONDOWN:
isDrag = true;
prevMousePos.x = GET_X_LPARAM(lParam);
prevMousePos.y = GET_Y_LPARAM(lParam);
break;
case WM_RBUTTONUP:
isDrag = false;
break;
case WM_MOUSEMOVE:
{
if ( isDrag )
{
POINT currentMousePos;
currentMousePos.x = GET_X_LPARAM(lParam);
currentMousePos.y = GET_Y_LPARAM(lParam);
float fDeltaX = (float)(currentMousePos.x - prevMousePos.x);
float fDeltaY = (float)(currentMousePos.y - prevMousePos.y);
camRotX += ( fDeltaY / 100.f );
camRotY += ( fDeltaX / 100.f );
if ( camRotX < -D3DX_PI / 0.5f + 0.0001f )
camRotX = -D3DX_PI / 0.5f + 0.0001f;
if ( camRotX > D3DX_PI / 0.5f - 0.0001f )
camRotX = D3DX_PI / 0.5f - 0.0001f;
prevMousePos = currentMousePos;
}
}
break;
case WM_MOUSEWHEEL:
camDistance += -GET_WHEEL_DELTA_WPARAM(wParam) / 100.f;
if ( camDistance < 1.0f )
camDistance = 1.0f;
break;
}
return 0;
}
开发者ID:SGA160108305C,项目名称:20160212_1_FVF_TEXTURE,代码行数:44,代码来源:Camera.cpp
注:本文中的GET_WHEEL_DELTA_WPARAM函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论