【发布时间】:2014-04-21 17:26:02
【问题描述】:
我有一个运行 Debian 的 BeagleBone Black,附带一个 480x272 像素的披风(触摸屏)。我将wicd 用于有线/无线接口,因为它有一个非常好的python/gtk-based solution 已经准备好供最终用户轻松设置各种网络配置。
问题是最终用户无法使用物理键盘,因此为了进入 wifi 设置,他们需要一个虚拟键盘。
我的主要项目是基于单声道的 (C#),我有一个用 GtkSharp (C#) 编写的虚拟键盘。我可以从我的其他 C# 项目文件中调用它,但无法从这个 python 模块中打开它。
我通常用以下方式调用wicd 客户端:
private void CallWicdDialaog()
{
Process proc = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "/usr/bin/wicd-client",
Arguments = "-n",
UseShellExecute = false,
RedirectStandardOutput = false,
CreateNoWindow = true
}
};
proc.Start();
}
这将在本机 Debian 操作系统中启动 python 进程,而不是通过 mono/C# 项目。除了这个虚拟键盘,我不需要wicd 和我的单声道项目之间的“交流”。
wicd 项目在其guiutil.py 文件中挂钩了一个 gtk focus 事件,如下所示:
class LabelEntry(gtk.HBox):
""" A label on the left with a textbox on the right, 370 pixels wide. """
def __init__(self,text):
...
self.entry.connect('focus-in-event', self.show_characters)
...
def show_characters(self, widget=None, event=None):
# When the box has focus, show the characters
""" I would like to hook my virtual keyboard in here """
if self.auto_hide_text and widget:
self.entry.set_visibility(True)
我想做的是在show_characters 定义中调用我的虚拟键盘。
我该怎么做?
- 有没有办法从这个 python 回调到单声道通信?
- 有没有办法将回调注入 python FROM mono?
- 我是否需要在 python 中重写基于 GtkSharp 的键盘,让 Debian OS 原生处理所有内容?
- 是否还有其他虚拟键盘可以处理如此小的屏幕空间?
- 有没有其他我没有想到的解决方案?
【问题讨论】: