I'm woking on a project of a chatting app, using tkinter, running on python 3.7 and Windows 10 OS. One of the things I would like to add to my app, is an option of opening up the Windows's Touch Keyboard.
Although you can open the keyboard by pressing its button on the taskbar, I would like to give access to it from my app. My idea is to bind an Entry widget, used as the console line of my app, to an event, that whenever it occurrs, it makes the Touch Keyboard to pop up. The event I'll probably be using is '<FocusIn>'
, which means that the keyboard focus is moved to it. Here is a quick example of the mechanics:
def open_keyboard(event):
pass # open the Touch Keyboard
root = Tk()
console = Entry(root, font=('Verdana', 14), cursor='pencil', bg='red', fg='yellow') # creating console
console.pack()
console.bind('<FocusIn>', open_keyboard) # bind the console to the event
root.mainloop()
NOTICE: The Touch Keyboard IS NOT the On-Screen Keyboard. I don't want to use this keyboard, because it poppes up as a new window and not as a Toplevel window, which blocks my chatting app. More Importantly, it has no Emoji keyboard :) A simple way to open the On-Screen Keyboard, is by running the following lines:
import os
os.system('osk')
I've been searching all over the internet for a solution, but they're all seem to be handling the On-Screen Keyboard. If someone knows how to help me or divert me to a source that explains how to handle it, he's more than welcomed to do so, because I'm stuck right now :/