How to simulate "Paste" or "CTRL + V"

zenfreak

Client
Регистрация
21.08.2013
Сообщения
249
Благодарностей
11
Баллы
18
I have a form that will not display the post button until I populate a field by paste-ing my value either by using right-click and selecting "paste" or by using CTRL+V.

Take note the if I manually write the value into that field the submit button will NOT show! Weird, I know, but that's the way it is.

What would be a workaround this?
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
524
Благодарностей
112
Баллы
43
You try use keyboard emulation?
Some data fields use scripts who don't accept "SET" value, for these fields, use KEYBOARD emulation.
There is no one C# or Java code to do it implemented on Zenno.
 

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
....
easier way here

Код:
// performs the copy even
instance.ActiveTab.KeyEvent("C", "press", "ctrl");
Код:
// performs the paste event
instance.ActiveTab.KeyEvent("V", "press", "ctrl");
 

zenfreak

Client
Регистрация
21.08.2013
Сообщения
249
Благодарностей
11
Баллы
18
@SOS Cartões OFC I tried keyboard emulation first
@Lord_Alfred Your solution worked like a charm. Thank you! I forgive you for only speaking Russian :-)
@PHaRTnONu Thank you for your solution but as Lord_Alfred stated, "don't forget about the buffer"!
 

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
What buffer? I don't see that comment?
 

zenfreak

Client
Регистрация
21.08.2013
Сообщения
249
Благодарностей
11
Баллы
18
If there are many threads and you are working with the clipboard by using
Код:
instance.ActiveTab.KeyEvent("V", "press", "ctrl");
they might overlap and you end up messing up each other's data. This is what I have understood by translating Lord_Alfred's post and even if I don't have too much coding experience it makes sense.
 

Lord_Alfred

Client
Регистрация
09.10.2015
Сообщения
3 916
Благодарностей
3 859
Баллы
113
If there are many threads and you are working with the clipboard by using
Код:
instance.ActiveTab.KeyEvent("V", "press", "ctrl");
they might overlap and you end up messing up each other's data. This is what I have understood by translating Lord_Alfred's post and even if I don't have too much coding experience it makes sense.
All right, but in fact it is better not to use change the buffer at all. It's unpredictable.
 
  • Спасибо
Реакции: PHaRTnONu

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)