Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Mouse Events in Console

  1. #11
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    58
    Posts
    3,299
    Rep Power
    348

    Re: Mouse Events in Console

    Hi folks, script works fine here too. MouseTrap, do you have a ball mouse or a led mouse? Later ones can be affected by light rays from your environment. I noticed this with my old logitech mouse sometimes. Even no one touched the mouse, the cursor was moving.

  2. #12

    Re: Mouse Events in Console

    Hello MouseTrap,

    did you tried to change the mouse (and/or port) and run the script again?
    The Console_InKey() function was build using WIN32 standard API so I'm really not expecting this oddity behaviour.

    Thank you very much and best regards,
    Roberto
    http://www.thinbasic.com

  3. #13
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174

    case %CONSOLE_MOUSE_WHEELED

    It's an older thread but I append this here to keep the informations together:

    What parameters give information about mousewheel-delta - so how many ticks up or down?
    I think there are missing some Forum-sections as beta-testing and support

  4. #14
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174
    push up again- still same question:

    is there a possibility to get direction of mousewheel?
    Uses "Console" 
    
    Dim s As String 
    Dim i As Long
    
    PrintL "Please press 'q' to exit."
    
    Do
       s = Console_InKey()
       sleep(0)
       i = len(s)
       select case i
          case 1
              PrintL "You pressed the " + s + " key."
          case 2
              Print "You pressed an extended key: " + Hex$(Asc(s, 2))
              '--Check second char of returned string
              Select Case Asc(s, 2)
                Case %VK_OEM_PLUS
                  PrintL " + (plus)"
                Case %VK_OEM_COMMA
                  PrintL " , (comma)"
                Case %VK_OEM_MINUS
                  PrintL " - (minus)"
                Case %VK_OEM_PERIOD
                  PrintL " . (period)"
                Case Else
                  PrintL " ... something else"
              End Select 
          case 3
            Select Case Asc(RIGHT$(s, 1))
                 case %CONSOLE_MOUSE_MOVED    
                     PrintL "You moved the mouse to" + Str$(Asc(LEFT$(s,1))) + "," + LTrim$(Str$(Asc(Mid$(s, 2,1)))) 
                 case %CONSOLE_DOUBLE_CLICK  
                     PrintL "You double clicked to" + Str$(Asc(LEFT$(s,1))) + "," + LTrim$(Str$(Asc(Mid$(s, 2,1)))) 
                 case %CONSOLE_LBUTTON
                     PrintL "You pressed the left button" 
                 case %CONSOLE_RBUTTON
                     PrintL "You pressed the right button" 
                 case %CONSOLE_MBUTTON
                     PrintL "You pressed the middle button" 
                 case %CONSOLE_MOUSE_WHEELED
                     PrintL "Mouse wheeled" 
            End Select
          end select
    LOOP UNTIL (i OR s = "q")
    
    I think there are missing some Forum-sections as beta-testing and support

  5. #15
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736
    Hi Rene,

    I think it is not possible using current version of the Console module, but maybe you could suggest it as feature - it should be doable with help of API function.
    ReadConsoleInput > INPUT_RECORD structure > MOUSE_EVENT_RECORD substructure, because they say the following for MOUSE_WHEELED:
    If the high word of the dwButtonState member contains a positive value, the wheel was rotated forward, away from the user. Otherwise, the wheel was rotated backward, toward the user.

    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Page 2 of 2 FirstFirst 12

Similar Threads

  1. mouse in console window
    By sandyrepope in forum Console
    Replies: 1
    Last Post: 30-05-2008, 23:40

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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