Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Keyboard navigation problems
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Keyboard navigation problems

 Post Reply Post Reply
Author
Message
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 899
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: Keyboard navigation problems
    Posted: 14 May 2008 at 10:32am
When I click on a popup button on the command bar ribbon and use the arrow keys to navigate the menu, the popup window does not consume the keystrokes.
 
This causes the application to also see the arrow keys and the result is the arrow key strokes are processed twice by the popup window (correct) but not by the application too (incorrect).
 
It looks like the problem is related to the "hook" procedures CJ uses. CJ is hooking into the keyboard events and processing certain keystrokes without removing the events from the event queue.
 
How can I force the CJ control to not allow the message to be passed onto the application once CJ decides the keystroke is meant for its control?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2008 at 1:36am
Hi,
 
Do you see same with any our sample ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 899
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2008 at 10:03am
Which sample do you have that reacts to the arrow keys?
 
Are you processing windows messages the normal way or are you using windows hooks to get the keystrokes and process them while allowing the events to proceed to the app where the events are processed using WindowProc procedures?
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 899
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 2008 at 11:15am
Oleg,
 
The "menu" is processing the arrows because CXTPKeyboardManager::SetupKeyboardHook has called SetWindowsHookEx.
 
When using a windows hook to access messages in an application, the application itself will still receive all the messages the hook receives.
 
In our application, the arrow keys are used to manipulate our view orientations. When we click on one of your popup buttons or any item that uses the arrow keys (e.g., galleries that have scroll bars) and then use the arrow keys, I see you hook routine getting called and it sends the key events (eventually) to the popup to navigate the user's selection.
 
After calling the hook, Windows then proceeds to process the message the normal way so the message makes it to our WindowProc and we process the keystroke too.
 
This is becoming a major issue in our application. Here is a sample of the call stack that shows me just why the archetecture of CJ is causing us these problems:
 
> ToolkitPro1120vc80D.dll!CXTPCommandBar::OnHookKeyDown(unsigned int nChar=0x00000028, long lParam=0x01500001)  Line 949 C++
  ToolkitPro1120vc80D.dll!CXTPPopupBar::OnHookKeyDown(unsigned int nChar=0x00000028, long lParam=0x01500001)  Line 1640 C++
  ToolkitPro1120vc80D.dll!CXTPCommandBar::OnHookMessage(HWND__ * __formal=0x00000000, unsigned int nMessage=0x00000100, unsigned int & wParam=0x00000028, long & lParam=0x01500001, HWND__ * __formal=0x00000000)  Line 1151 + 0x22 bytes C++
  ToolkitPro1120vc80D.dll!CXTPKeyboardManager::ProcessKeyboardHooks(unsigned int nMessage=0x00000100, unsigned int wParam=0x00000028, long lParam=0x01500001)  Line 391 + 0x21 bytes C++
  ToolkitPro1120vc80D.dll!CXTPKeyboardManager::KeyboardProc(int code=0x00000000, unsigned int wParam=0x00000028, long lParam=0x01500001)  Line 433 + 0x15 bytes C++
  user32.dll!_DispatchHookA@16()  + 0x56 bytes 
  user32.dll!_CallHookWithSEH@16()  + 0x21 bytes 
  user32.dll!___fnHkINDWORD@4()  + 0x28 bytes 
  ntdll.dll!_KiUserCallbackDispatcher@12()  + 0x2e bytes 
  user32.dll!_DispatchHookA@16()  
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 16 May 2008 at 1:34am
Hi,
 
I don't understand.
Do you see same problem in our RibbonSample. Do you see RTF text handle arrows with Menus?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.033 seconds.