Announcement

Collapse
No announcement yet.

Mouse Support In Win2000

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mouse Support In Win2000

    Hi, I'm having a problem reading the mouse in PB/CC 2.0. I'm running Win2000 and trying to read it using INKEY$ with the following code (which works in Windows Millenium Beta 3 by the way):
    Code:
    Function PbMain()
      Mouse On
      Mouse 7, Double, Move, Down, Up
      Do
        If InKey$ <> "" Then
          Locate 1,1
          Print InKey$;
        End If
      Loop Until InKey$ = Chr$(27)
    End Function
    If anyone with Win2000 could try this out or show me the proper way to read the mouse, I'd sure appreciate it.
    Thanks


    -------------
    Wyman Belts
    [email protected]

  • #2
    It's a problem in your code, not Windows 2000...

    Code:
    If InKey$ <> "" Then
      Locate 1,1
      Print InKey$;
    End If
    The first INKEY$ is removing the keystroke from the keyboard buffer, so there is nothing
    for PRINT to print.

    Try this instead...

    Code:
    If INSTAT Then
      Locate 1,1
      Print InKey$;
    End If
    I have no idea why it would work under Windows ME... it shouldn't!

    -- Eric
    ------------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>



    [This message has been edited by Eric Pearson (edited May 12, 2000).]
    "Not my circus, not my monkeys."

    Comment


    • #3
      Thanks for the quick reply Eric,
      I chopped some of the extra stuff out of there and messed up the Inkey$ part, but what actually happens is that I don't even get a REACTION out of the console. The mouse movement should show up anyway since there are so many mouse movements reported. Are you or anyone else able to use the mouse functions in 2000? Another thing, when I click in the console the title changes to "Select..blah blah", does yours do that?
      Thanks Again

      ------------------
      Wyman Belts
      [email protected]

      Comment


      • #4
        Such code is able to "work", because movement of mouse generates a lot of events (first Inkey "eats" first, but second event is in query).
        Of course, code is wrong.
        But under Win2000 (and not under it), could be another problem.
        Wyman, start any console app in window. Right click on caption.
        Defaults. Options. Find "Edit options" frame and switch off flags ("Quick Edit Mode", "Insert Mode").

        ------------------

        Comment


        • #5
          Wyman --

          What you're seeing is the Windows 2000 "Quick Edit" mode. If you press Alt-Space and select Properties and the Options tab, you'll see that the QuickEdit Mode box is checked. Uncheck it and your PB/CC app will behave the way you expect.

          Better yet, instead of Properties use Defaults and change the machine's default console setting.

          (Oops... I see that Semen has already given you basically the same answer.)

          -- Eric


          ------------------
          Perfect Sync: Perfect Sync Development Tools
          Email: mailto:[email protected][email protected]</A>



          [This message has been edited by Eric Pearson (edited May 12, 2000).]
          "Not my circus, not my monkeys."

          Comment


          • #6
            You can thank Microsoft for this situation, because they changed the default "Quick Edit" mode setting from Off to On when Windows 2000 was released. Thanks Bill! Not only that, they changed the default row-count from 25 to 300, so every console app now has a scrollbar running down the right-hand side on Windows 2000 systems unless the program explicitly sets the row count to 25, which was completely unnecessary with all previous versions of Windows. Thanks again Bill!)

            It occurs to me that if you are distributing a PB/CC app to a number of customer sites, it will be very inconvenient -- perhaps even unprofessional -- to require the setup of every PC to be manually configured before your program will work correctly on Windows 2000.

            So I've just finished modifying our CWC program (which is part of my company's Console Tools package) to set the Quick Edit mode programmatically, without requiring the PC's default settings to be changed in any way. (CWC already automatically sets the row-count to 25.) As soon as I finish testing it I'll send a copy of the new version to all current Console Tools users.

            CWC will also be made available as an inexpensive stand-alone program in the very near future, if you'd like to use CWC but don't feel you need the entire Console Tools package.

            -- Eric


            ------------------
            Perfect Sync: Perfect Sync Development Tools
            Email: mailto:[email protected][email protected]</A>

            "Not my circus, not my monkeys."

            Comment


            • #7
              That did it. Thanks guys

              ------------------
              Wyman Belts
              [email protected]

              Comment


              • #8
                Eric,
                ..Can you add this feature to ConsoleTools as well. There are times when i don't want to use CWC.


                ------------------
                Marty
                mailto:[email protected][email protected]</A>

                Comment


                • #9
                  Marty --

                  Unfortunately no. The Quick Edit Mode is part of a group of values that can only be set programmatically before the console is created. (That is to say, the Quick Edit Mode can be set manually, by using the Properties Menu, at any time. But it can't be set programmatically after the console appears.) If your app is already running it's too late, and you can't use any Console Tools functions until your app is running.

                  You can use the ConsolePropMenu function to automatically pop up the Properties menu when a PB/CC app starts up, so the user can un-check the box more easily, if that would help. But it's not what I would call an ideal solution.

                  -- Eric

                  ------------------
                  Perfect Sync: Perfect Sync Development Tools
                  Email: mailto:[email protected][email protected]</A>

                  "Not my circus, not my monkeys."

                  Comment


                  • #10
                    Another thought... If it's just a program for your own use, you could do this...

                    Code:
                    ConsolePropMenu        'display the Properties Menu
                    ConsoleKey "Q"         'select Quick Edit checkbox
                    ConsoleKey "-"         'force checkbox to "unchecked"
                    ConsoleKey CHR$(13)    'Enter, to close the dialog
                    ConsoleKey CHR$(13)    'Enter, for "this session only"
                    I wouldn't do that for a "production" app that other people will use, but it's not a bad "convenience" function to add to the beginning of programs during development. Then use CWC when the app is finished, for a cleaner startup.

                    -- Eric

                    ------------------
                    Perfect Sync: Perfect Sync Development Tools
                    Email: mailto:[email protected][email protected]</A>

                    "Not my circus, not my monkeys."

                    Comment

                    Working...
                    X