CompuServe Messages

Paste Function

#: 125645 S10/ProgrammingForum unknown
    20-May-88 19:37:51
Sb: #125279-Paste Function
Fm: jack radigan 76545,201
To: Ray Lambert 76077,1653

This message turned up in search, but its forum couldn’t be identified from the original transcript, so it may not be linked into its thread.

Ray, The way you'd want to add data to a window as if it were typed from the keyboard is through the input device using the IND_WRITEEVENT command. This is the way my program, CoPilot, spits out a keyboard macro. The two problems you'll have to account for are: Only the active window will receive a VANILLA/RAW class event, since your calculator window will have opened, the calling window will have been de-activated. I think you'll be able to make the pasting function act intuitive by looking for the IDCMP flags ACTIVEWINDOW and INACTIVEWINDOW. when you recieve the INACTIVEWINDOW flag, check the IAddress element to see if it matches your calculator's window pointer. If it does, wait for the next ACTIVEWINDOW flag, check it's IAddress, if it isn't your calculator, send the data to the input device. You'll probably need a "PASTE" gadget to enable this logic sequence. The next thing is which raw key codes to use for sending the data. I'd go with the keyboard rather than the keypad in case some programs out there look at raw key data instead of vanilla. I'm also fairly certain that you'll be compatible with the 500, 1000 & 2000 this way and even with non-US keymaps too. -Jack-