My recent experience with a bluetooth barcode scanner...
The scanner has two main modes. The first is HID (Human Interface Device) keyboard mode. For control via software the second mode is SPP (Serial Port Profile).
HID allows it to easily connect to devices such as an iPad which has the capability to connect to standard bluetooth keyboards. When you have selected a field in an iOS app and then scan, the scanned item is entered into the field as if you typed it.
SPP allows you to write software to communicate with the device. This is very dependent on the manufacturer to develop a SDK. In my case, the manufacturer has developed SDKs for iOS, Android, and Blackberry. I'm working with the iOS one which allows me to change feedback, get battery level and a few other things.
If you are the developer of the software you want to control, I'd think that you would need to use the SPP mode. If you are just a Joe user, I have my doubts that you could customize a HID keyboard to select a particular button. You'll need to see how the interaction between the keyboard, virtual or not, is handled with software. I don't recall seeing a close interaction that would allow knowledge of the app from the keyboard input. I'd like to be proven wrong of course.