Print Page | Close Window

Keyboard navigation problems

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=10621
Printed Date: 01 March 2025 at 6:24am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Keyboard navigation problems
Posted By: rdhd
Subject: Keyboard navigation problems
Date 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?



Replies:
Posted By: Oleg
Date Posted: 15 May 2008 at 1:36am
Hi,
 
Do you see same with any our sample ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: rdhd
Date 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?


Posted By: rdhd
Date 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++
   mailto:user32.dll!_DispatchHookA@16 - user32.dll!_DispatchHookA@16 ()  + 0x56 bytes 
   mailto:user32.dll!_CallHookWithSEH@16 - user32.dll!_CallHookWithSEH@16 ()  + 0x21 bytes 
   mailto:user32.dll!___fnHkINDWORD@4 - user32.dll!___fnHkINDWORD@4 ()  + 0x28 bytes 
   mailto:ntdll.dll!_KiUserCallbackDispatcher@12 - ntdll.dll!_KiUserCallbackDispatcher@12 ()  + 0x2e bytes 
   mailto:user32.dll!_DispatchHookA@16 - user32.dll!_DispatchHookA@16 ()  


Posted By: Oleg
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net