How get click event of hardware button of device ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rishabh Indianic
    New Member
    • Sep 2009
    • 22

    How get click event of hardware button of device ?

    i am trying to get and fire some action on click of back button of device " <--" . but i can not able to get click event of device hardware button. please give me idea to get click event of device button.I am able to capture the key presses of virtual keyboard ..but not able to capture the hard keys.
    please give me solution of this thread how i catch event of hardware button.
    i am used HTC touch diamond 2 to run my application. and framework that i am used is VS 2005, sdk 6.0 with c#.
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    You are probably looking for some kind of WM_HOTKEY message that will either be from VK_TBACK or some other soft button like VK_TSOFT1 or VK_TSOFT2 this is all implemented by your device manufacturer, so you have two options:

    Option 1: Implement a keypress reporter and everytime a button is pressed on the device it will report to you what the programmatic name of the key is.

    Option 2: Contact HTC and ask them how they implemented their keyborad driver and how it reports back button presses.

    Otherwise you can hunt around in MSDN until WM 8 comes out and you may not find an answer.

    Comment

    • markmcgookin
      Recognized Expert Contributor
      • Dec 2006
      • 648

      #3
      I think if in the emulator if you hit a hardware key you will get a list of events for when a direction key is pressed... I THINK .... you might be able to capture keyboard input on this.. stick a breakpoint on that method and see if it fires and is ignored when a keyboard key is struck... you might then just need to get the ID/Index of that key.

      Comment

      Working...