我如何获得我在Google搜索栏上输入的文本,例如react Native
实际上,当我想在Google搜索栏上输入时,我想构建可以捕获所有击键的东西。这可以在React Native中构建吗?没有我自己的键盘。它应该像钥匙记录员一样从任何地方获得任何输入
Actually, I want to build something that can catch every keystroke when I want to type on the google search bar. is that possible to build in react native? without my own keyboard. it should get any input from anywhere like a keylogger
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许您可以尝试收听输入的更改事件
例如:
maybe you can try listen change event of input
for example:
如果您希望输入在输入时更改,则应按照这样的措施进行操作:
这将使之成为现实,以便每个按键都会更新
Input
,并删除曾经写过的内容。您还应该在
提交
按钮或search
按钮中具有更清洁的逻辑,以将输入重置为空字符串'',以便您不是剩下以前的文本,必须每次删除IR。这样的事情:if you want your input to change as you type then you should follow something like this:
This will make it so every keystroke will update the
input
as well as deleting what was once written on it.You should also have a cleaner logic in your
submit
button orsearch
button to reset the input to an empty string again''
so you are not left with the previous text and having to delete ir every time. Something like this: