CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2000
    Location
    Wi, USA
    Posts
    144

    Three finger menu support

    Hello!

    I need to activate menu items via 'three finger salute' such as [ctrl]-[alt]-[N].

    It is my conclusion that Visual Basic just does not support this functionallity.

    Does anybody have evidence to the contrary?

    If you have ever implemented this functionality, I would love to hear form you!

    Dave Sell

    Note the 'recent' new prefix standards for Information Technology Experts.
    http://helios.augustana.edu/~dr/kibibytes.html

  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: Three finger menu support

    If you have the form's Keypreview set to True, your form gets a key event in which you could show the menu...
    If you want the same sort of thing but on a system wide basis you need to install a low level keyboard hook (WH_KEYBOARD_LL). This latter is much more complex, but there is code in http://www.merrioncomputing.com/Download/index.htm which should help.

    HTH,
    D

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  3. #3
    Join Date
    Feb 2000
    Location
    Ireland
    Posts
    808

    Re: Three finger menu support

    As Duncan says set the forms Keypreview property to true then use this code

    Dim ctrl1 as Boolean
    Dim alt1 as Boolean
    Dim letterM as Boolean


    private Sub Form_KeyDown(KeyCode as Integer, Shift as Integer)
    ctrl1 = (Shift And vbCtrlMask)
    alt1 = (Shift And vbAltMask)
    letterM = IIf(KeyCode = 77, true, false)

    If ctrl1 And alt1 And letterM then
    mnuf.Visible = true
    End If
    End Sub



    I have a top level menu called mnuf and I'm using ctrl-alt-M


  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Three finger menu support

    Great. I will rate you tomorrow (out of vote for today!)

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured