How can I send text to Edit Text control?
#1
Question 
Hi,

How can I send text to an Edit Text control (or clear it) in one of the kodi xml windows/dialogs?

My purpose is to catch the Keyboard dialog and send him the text for searching.
(Assuming that I know their ID's)

Thanks.
Reply
#2
(2016-11-18, 09:48)burekas Wrote: Hi,

How can I send text to an Edit Text control (or clear it) in one of the kodi xml windows/dialogs?

My purpose is to catch the Keyboard dialog and send him the text for searching.
(Assuming that I know their ID's)

Thanks.

By default the edit control should handle getting the text from the keyboard.

PHP Code:
myEditControl.getText();
myEditControl.setText(); 

http://mirrors.xbmc.org/docs/python-docs...ontrolEdit
https://codedocs.xyz/xbmc/xbmc/class_x_b..._edit.html
http://alwinesch.github.io/group__python...ntrol_edit

See below if you wish to use a custom keyboard and get text, there is an example

http://mirrors.xbmc.org/docs/python-docs...l#Keyboard
https://codedocs.xyz/xbmc/xbmc/class_x_b...board.html
http://forum.kodi.tv/showthread.php?tid=...m+keyboard
Reply
#3
OK, but the keyboard doesn't create by me or by my addon,
The keyboard is opened from the Manual Search button in the Subtitles Dialog.
So I need to control this dialog.

Foe example I'm using:
PHP Code:
xbmc.executebuiltin('xbmc.SendClick(10103,300)')  # 10103 = keyboard , 300 = OK button 
For click on the "OK" button

But there is no function for sending text.
Reply
#4
In addition, does somebody knows why when I performs sendclick for the 'z' id, the keyboard closes himself?
PHP Code:
xbmc.executebuiltin('xbmc.activatewindow(subtitlesearch)')
xbmc.executebuiltin('xbmc.SendClick(10153,160)'# 10153 = subtitles dialog id , 160 = Manual Search button
xbmc.executebuiltin('xbmc.SendClick(10103,160)')  # 10103 = keyboard dialog id , 160 = 'z' button id 

But for all the other keys the keyboard doesn't close, for example with 'a':
PHP Code:
xbmc.executebuiltin('xbmc.activatewindow(subtitlesearch)')
xbmc.executebuiltin('xbmc.SendClick(10153,160)'# 10153 = subtitles dialog id , 160 = Manual Search button
xbmc.executebuiltin('xbmc.SendClick(10103,140)')  # 10103 = keyboard dialog id , 140 = 'a' button id 
Reply
#5
I would advice strongly against such hacks. This is far too error prone to work reliable. This could fail on slow/busy systems and would introduce a briefly flashing text search/characters.

It seems to me that you could write a subtitle add-on instead.
Reply
#6
Ok, I did a subtitle add-on

Is there any way to run another subtitle addon from my subtitle addon, and passing the args from my addon to him?
Basically I tried to do so (With Runscript), but there is a problem with the handle value when I pass it (Attempt to use invalid handle) because the other addon need a handle id for his addDirectoryItem & endDirectory functions.
How can I solve this?

The idea is like this: Subtitles Dialog => activate my subtitle addon => run another existing subtitle addon with title which created by my addon => Show the results in the Subtitles Dialog.
Reply
#7
You have two options: call some functions of the add-on directly or fork it.
Reply

Logout Mark Read Team Forum Stats Members Help
How can I send text to Edit Text control?0