用自定义char替换闪烁的文本光标 [英] Replace blinking text cursor with custom char
问题描述
我正在创建像MySQL cmd这样的东西并且有完整的设计,我想用下划线唱替换插入点(闪烁的线)。任何提示?
I'm creating something like MySQL cmd and to have complete design, I want to replace insertion point (that blinking line) with underline sing. Any tips?
推荐答案
如果你希望这很容易,那么坏消息就是没有一个快速的这样做的简单方法 - 文本光标不是你可以用几行javascript或CSS改变的东西。
If you were hoping this would be easy, the bad news is that there simply isn't a quick and simple way to do this -- the text cursor is not something you can just change with a couple of lines of javascript or CSS.
如果你真的想这样做,你需要在javascript中编写自己的整个文本输入系统 - 自己显示光标,等待按键,将它们打印到屏幕上,手动处理包装等任何内容....这有点像
If you really want to do this, you're going to need to write your own entire text input system in javascript -- display the cursor yourself, wait for key presses, print them to the screen, handle anything like word-wrapping manually.... it's a fair bit of work.
幸运的是,其他人已经完成了这项工作并可以分享,所以我建议你最好的出发点是看一些现有的例子和看看他们是如何做到的。
Fortunately, others have already done this work and made it available to share, so I suggest your best starting point would be to take a look at some existing examples and see how they've done it.
这是我用google搜索得到的一个: http://terminal.jcubic.pl/ 。还有很多其他的你可以试试。
Here's one I found with a quick bit of googling: http://terminal.jcubic.pl/. There are plenty of others you could try as well though.
希望有所帮助。
这篇关于用自定义char替换闪烁的文本光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!