Announcement

Collapse
No announcement yet.

Capture CTRL key status at Mouse time?

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

  • Capture CTRL key status at Mouse time?

    Is it possible somehow with PB 3.5 to capture that the CTRL, ALT or
    SHIFT key is being held down on the keyboard at the same time the
    PB mouse routines return a mouse click location?

    Thanks ..


    ------------------
    Mike Luther
    [email protected]
    Mike Luther
    [email protected]

  • #2
    Yep! Interrupt &h16, sub-function 02 will do just that. I used
    to have the some code but seem to have misplaced it.
    Code:
    function KeyBoardStat$
            reg 1, &h0200
            call interrupt &h16
            t$ = bin$(reg(1))    ' Stats returned in AL
            do until len(t$) = 16
            t$ = "0" + t$
            loop
            function = right$(t$,8)
            end function
    
    
    1 = ...
    
    0  0  0  0  0  0  0  0
    |  |  |  |  |  |  |  |__ Right shift key pressed
    |  |  |  |  |  |  |_____ Left shift key pressed
    |  |  |  |  |  |________ Either control key pressed
    |  |  |  |  |___________ Either Alt key pressed
    |  |  |  |______________ Scroll lock on
    |  |  |_________________ Num lock on
    |  |____________________ Caps lock on
    |_______________________ Insert on
    Typed this in freehand from memory. You may have to play with
    it some.


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


    [This message has been edited by Mel Bishop (edited July 13, 2005).]
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

    Comment


    • #3
      Thanks Mel ..

      Pointed me back to and matches information in Jourdain's "Programmer's
      Problem Solver for the IBM PC, XT & AT" - Page 104 and 105. That book
      hadn't been off the shelf here for a LONG time. It'll let me mimic my
      already existing code pickoff for those keys in combination with the
      arrow keys here. I'll combine it with something a little more eye
      catching than the ASCI CHR$ 24-27 to mimic the arrow keys for operator
      prompting and training to get their hands back off the mouse and to
      the keyboard for speed and usefulness...





      ------------------
      Mike Luther
      [email protected]
      Mike Luther
      [email protected]

      Comment


      • #4
        Wow, Mel, I'm impressed! I was already aware that you're pretty
        competent at DOS programming, but I didn't know that it was to
        the extent of being able to spell out the functioning of an interrupt
        from MEMORY! I consider my own self to be reasonably competent at
        DOS programming, but not anywhere close to that extent.

        My respect for your abilities has grown considerably.

        P.S. These are literal statements, not sarcastic ones.



        ------------------
        clay at clayclear dot net

        Comment


        • #5
          Concept is working here Mel ..

          Thanks for your suggestion!




          ------------------
          Mike Luther
          [email protected]
          Mike Luther
          [email protected]

          Comment

          Working...
          X