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


    User Avatar
    Gold Member

    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
    then I press the button (or combination of buttons)
    and the system adds
    ## around the text I have selected.

    OS - Windows 8

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


    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
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook