Hi,
(I know I can use the SendInput api, but that's way more hustlle then Send() or keyb_event.)
to make a long story short:
I need to generate a "backspace" press on the keyboard.
The reason is that I'm working with a richtext control, paste an html table with it's own CSS. To do so I first have to add a " " after the insertion point, if not I'm having "problems".
It works great, but I want to get rid off the " " at the end. I've tried copytrf(false) and then replace the " " with nothing but I keep having the "problems".
keyb_event is supposedly obsolete, but I still can get it to work. Preferably I'd use the Send() function. I can get a "Delete" press working, but I can't get the "Backspace" working. It IS detected in the key event as KeyBack!, but it doesn't do anything on my sle_1.
Here's some code and I'll attach a small sample app in pb2017:
There's 3 buttons, (one invisible, but holds info I might use). Two others for Send() and Keyb_event()
Note: The button for keyb_event only works correctly when not clicking on it, but by using the TAB key to position the focus on it and then using "spacebar" to run the clicked event.
long ll_handle
Constant Long VK_keyDelete = 46 // delete = 46 works, but should be 127?
Constant Long VK_keyBack = asc('~b') // deteced in keyevent correctly as value ll_i = 8 an key = keyBack!, but doesn't do anything?
Constant UInt WM_KEYDOWN = 256
Constant UInt WM_KEYUP = 257
ll_handle = handle(sle_1)
setfocus(sle_1)
// this works, with code 46, but not with the expected code 127?
Send(ll_handle, WM_KEYDOWN, VK_keyDelete, 0)
Send(ll_handle, WM_KEYUP, VK_keyDelete, 0)
setfocus(sle_1)
// this is correctly detected in a key event, but doesn't do anything on the sle_1?
// What am I missing?
Send(ll_handle, WM_KEYDOWN, VK_keyBack, 0)
Send(ll_handle, WM_KEYUP, VK_keyBack, 0)
TIA regards