How do i make this possible? [button programming]

  • Thread starter Thread starter Rectifier
  • Start date Start date
  • Tags Tags
    Programming
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
Rectifier
Gold Member
Messages
313
Reaction score
4
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?
 
Physics news on Phys.org
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.