Results 1 to 15 of 15

Thread: VB6 Keybindings

  1. #1

    Thread Starter
    Addicted Member rkeslar's Avatar
    Join Date
    Jul 2009
    Location
    Pittsburgh, PA
    Posts
    145

    Question VB6 Keybindings

    Is it possible to change the keybindings in VB6? Right now,

    Step Over is Shift + F8
    Step Into is F8

    I'd like to make them the say as I have in VB.NET where

    Step Over is F10
    Step Into is F11

    Thanks

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: VB6 Keybindings

    You can do it in couple of ways:

    - create menu and for each menu item assign shortcut and then code each menu's click event to do whatever
    - or use code similar to this quick sample
    Code:
    Option Explicit
    
    Private Sub Form_Load()
        Me.KeyPreview = True
    End Sub
    
    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
        Select Case Shift
            Case vbShiftMask
                Select Case KeyCode
                    Case vbKeyF8
                        Debug.Print "SHIFT+F8 key was pressed"
                    Case vbKeyF10
                        Debug.Print "SHIFT+F10 key was pressed"
                End Select
            Case vbCtrlMask
                Debug.Print "CTRL key was pressed"
            Case vbAltMask
                Debug.Print "ALT key was pressed"
            Case 0
                Select Case KeyCode
                    Case vbKeyF8
                        Debug.Print "F8 key was pressed"
                    Case vbKeyF10
                        Debug.Print "F10 key was pressed"
                End Select
        End Select
    End Sub

  3. #3
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: VB6 Keybindings

    RB

    I read OP's request as to have it apply to the IDE,
    ie, when the app is in break-mode (ie, when app's
    code is being debugged).

    I don't understand how your code remaps
    • F10 to be what was formerly Shift+F8
    • F11 to be what was formerly F8

    What am I missing?

    Spoo

  4. #4

  5. #5
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: VB6 Keybindings

    RB

    Haha.. not that I wanted to be..
    I, too, would like to know how to remap those keys

    Spoo

  6. #6

  7. #7

  8. #8
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: VB6 Keybindings

    Quote Originally Posted by RhinoBull View Post
    Why? ..
    RB

    Well, now that you ask ...

    There are times that during a debugging endeavor,
    I am comparing a current version of the app to the
    prior version of the app, and really need to drill down
    to find a bug.

    I do this on 2 boxes, and thusly am pressing F8 on
    each keyboard as I step thru, line by line. I have
    a lot of custom functions that I know are ok, so,
    really, I need to press Shift+F8 to Step Over...
    which, as you might be able to surmise, gets
    a little tricky doing with 1 hand on each keyboard.

    Hence, I'd like to be able to remap the dual key
    Shift+F8 to a single F key, say F12,
    or, put another way, enable F12 to do a Step Over

    Is it possible to do that?

    Spoo
    Last edited by Spoo; Jun 17th, 2010 at 08:20 AM.

  9. #9

  10. #10
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: VB6 Keybindings

    Quote Originally Posted by FireXtol View Post
    AutoHotKey can(sort of).
    FX

    I checked out their site, and under FAQ found something
    on remapping...
    1. using their app,
    2. w/o their app, but instead, using Registry assignment

    The latter would be more to my liking.. I'll ponder this
    for a while.

    Spoo

  11. #11
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: VB6 Keybindings

    RB

    Yeah.. my piano teacher would be proud of me

    EDIT:
    In actuality, I'd like to do this with one hand only...
    my keyboards are one-in-front-of-other, so I'd like
    to be able to use
    • index finger on F12 of kb-1
    • thumb on F12 of kb-2


    Spoo
    Last edited by Spoo; Jun 17th, 2010 at 08:42 AM.

  12. #12
    Fanatic Member FireXtol's Avatar
    Join Date
    Apr 2010
    Posts
    874

    Re: VB6 Keybindings

    I don't think that'll work....

    Quote Originally Posted by disadvantages of registry remapping
    It cannot send keystrokes that are modified by Shift, Control, Alt, or AltGr. For example, it cannot remap a lowercase character to an uppercase one.
    Such as Shift+F8.

  13. #13
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: VB6 Keybindings

    FX

    Thanks for that.

    So, what is your reading of their app's capabilities?
    I really only scanned it briefly .. can it deal with
    the Shift+F8 combo?

    Spoo

  14. #14
    Fanatic Member FireXtol's Avatar
    Join Date
    Apr 2010
    Posts
    874

    Re: VB6 Keybindings

    Quote Originally Posted by Spoo View Post
    FX

    Thanks for that.

    So, what is your reading of their app's capabilities?
    I really only scanned it briefly .. can it deal with
    the Shift+F8 combo?

    Spoo
    Indeed. AHK is popularly used for 'botting'(or 'tool assistance') in games due its scripting capabilities. But it can also do every day repetitive tasks with games or your average app. It's adaptable.

    It's like an advanced version like JoyToKey... sort of.

  15. #15
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: VB6 Keybindings

    FX

    OK.. I'll give it a further look-see.
    Thnkx

    Spoo

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