使用 UNIX 机器文件和目录选项卡自动完成的 Windows 应用程序
Unix / Linux 支持按“tab”时自动完成文件和目录。 我需要在我的 Windows 应用程序中创建此功能。我有一个用于用户输入文件名的文本字段,我想响应“制表符”按下,就像我们在 Unix 控制台中一样:
- 如果有一个选项 - 自动完成。
- 一些选项 - 显示选项列表。
- 没有选择-什么也没有。
对于与我的 unix 机器的 SSH 连接,我使用 ch.ethz.ssh API。
有办法这样做吗?
Unix / Linux support auto-complete of files and directories when pressing "tab".
I need to create this ability in my windows application. I have a text field for user input of file name, which I want to respond to a "tab" press like it will do when we're in a unix console:
- If there is one option - Auto-complete.
- Some options - show a list of the options.
- No options - nada.
For my SSH connection to my unix machine I use the ch.ethz.ssh API.
Is there a way to do so?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您希望有一个没有焦点循环和制表符抑制的文本字段:
然后是文件的数据模型(此处是本地目录,但 SSH 同样如此):
然后是 TAB 的按键处理:
查找文件名中最长的公共前缀。显示该内容。
缺少的是不明确的文件名的显示。弹出菜单会很好,不是吗?
弹出窗口:
First you want to have a text field without focus cycling, and tab suppression:
Then a data model for the files (here local directory, but SSH is likewise):
Then a key pressed handling for the TAB:
Look for the longest common prefix in the file names. Display that.
What is missing is the display of the ambiguous file names. Popup menu would be nice, wouldn't it?
Popup: