Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How do i make this possible? [button programming]

  1. Sep 4, 2014 #1

    Rectifier

    User Avatar
    Gold Member

    Hey!
    I would like to program my key on the keyboard to do a specific task. In my case, I would like it to do following:
    I select a bit of text
    12u6g2d.jpg
    then I press the button (or combination of buttons)
    and the system adds
    ## around the text I have selected.
    BWurt3V.jpg

    OS - Windows 8

    Anyone that can help?
     
  2. jcsd
  3. Sep 4, 2014 #2

    DavidSnider

    User Avatar
    Gold Member

    Is this for a single application or all applications? There isn't really a reliable way of doing this for any program.
    Best bet is to read it from the clipboard and if it matches a specific pattern then evaluate it.

    For a single application it's pretty easy. Almost every textbox implementation has a Control.SelectedText property you can read.
     
  4. Sep 7, 2014 #3
    Last edited: Sep 7, 2014
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook