Help in AutoKeys - Sending a Shifted Case Letter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nonpetable
    New Member
    • Oct 2015
    • 6

    Help in AutoKeys - Sending a Shifted Case Letter

    hellos im jason and i am trying to send <shift> + o
    but i want the o to be a capital O. this o is in the o in OH. then when i press w the script will stop.
    this script will not send the shifted O only the lowercase o.
    im using the program Autokey



    Code:
    keyboard.send_key("<SHIFT>")
    time.sleep(.33)
    keyboard.press_key("o")
    time.sleep(.33)
    #keyboard.press_key("<shift>")
    time.sleep(2.33)
    keyboard.release_key("w")
    Last edited by Rabbit; Oct 20 '15, 04:13 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32645

    #2
    Hello Jason. Are you in the right forum? This is for Access and VBA, but your code doesn't look like VBA.

    If you want to do similar stuff in VBA then you'd use :
    Code:
    SenKeys()

    Comment

    • nonpetable
      New Member
      • Oct 2015
      • 6

      #3
      if you seach string "autokey" on bytes.com all the other posts related to Autokey are in home > topics > microsoft access / vba > questions > keyboard shortcuts to execute code? but if im wrong please help me get in teh righ t location thanks again

      Comment

      • nonpetable
        New Member
        • Oct 2015
        • 6

        #4
        could you reread this post and see if it makes more sense now

        Comment

        • jforbes
          Recognized Expert Top Contributor
          • Aug 2014
          • 1107

          #5
          I don't recognize the language you are using, but you could try using and uppercase "O" instead of a lower case "o":
          Code:
          keyboard.press_key("O")
          'instead of
          keyboard.press_key("o")

          Comment

          • nonpetable
            New Member
            • Oct 2015
            • 6

            #6
            i ment to say i need a persitant shift and the o key to like <shift>o

            Comment

            • jforbes
              Recognized Expert Top Contributor
              • Aug 2014
              • 1107

              #7
              From https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx

              To specify that any combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, enclose the code for those keys in parentheses. For example, to specify to hold down SHIFT while E and C are pressed, use "+(EC)". To specify to hold down SHIFT while E is pressed, followed by C without SHIFT, use "+EC".

              Comment

              • nonpetable
                New Member
                • Oct 2015
                • 6

                #8
                this is in wrong place is python sorrys but answer is
                keyboard.press_ key ("<shift>+o" )
                the + modifier makes them both presses

                Comment

                • nonpetable
                  New Member
                  • Oct 2015
                  • 6

                  #9
                  the best way is not to ask python questions in VBA
                  but what works is
                  keyboard.send_k ey("<shift>+o" )
                  the + modifier sends them both without teh + it would send shift then o
                  or keyboard.press_ key("<shift>+o" )

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32645

                    #10
                    Let me move this to the Python forum for you. I don't know how busy it is over there or who's hanging in there ATM but it's a better place for the question than here.

                    Good luck :-)

                    Comment

                    Working...