- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using OneAPI Fortran 2023.2.0 to write a Win32 program on Windows 10. Where could I catch the Arrow key event? I can catch normal keys under WM_KEYDOWN. But the code below doesn't work for Virtual Key like the Arrow Keys.
Thanks for help.
Cheers,
Cean
integer function WndProc( hwnd, message, wParam, lParam )
select case (message)
case (WM_KEYDOWN)
wParam = and(wParam, #0000ffff)
select case (wParam)
case (VK_LEFT)
!// Process the LEFT ARROW key.
ret = MessageBox (hwnd, "Left arrow is pressed"C, "Hi"C, MB_OK)
return
case (VK_RIGHT)
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. I should not call the TranslateMessage function.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have any PeekMessage calls within you message processing that are intercepting these keystokes maybe?
Also if the cursor is in certain windows e.g. in a text box the arrowed keys get intercepted by windows for the carot position movement maybe that is a problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. I should not call the TranslateMessage function.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page