pythonsendkeys空格_Sendkeys功能故障

所以我下载了一个Python2.7的Sendkeys版本。它的工作太好了!对于可以在字符串中输入的字母和数字。

函数的形式如下:def SendKeys(keys,

pause=0.05,

with_spaces=False,

with_tabs=False,

with_newlines=False,

turn_off_numlock=True):

"""

Sends keys to the current window.

`keys` : str

A string of keys.

`pause` : float

The number of seconds to wait between sending each key

or key combination.

`with_spaces` : bool

Whether to treat spaces as ``{SPACE}``. If `False`, spaces are ignored.

`with_tabs` : bool

Whether to treat tabs as ``{TAB}``. If `False`, tabs are ignored.

`with_newlines` : bool

Whether to treat newlines as ``{ENTER}``. If `False`, newlines are ignored.

`turn_off_numlock` : bool

Whether to turn off `NUMLOCK` before sending keys.

example::

SendKeys("+hello{SPACE}+world+1")

would result in ``"Hello World!"``

"""

这些代码如下:CODES = {

'BACK': 8,

'BACKSPACE': 8,

'BS': 8,

'BKSP': 8,

'BREAK': 3,

'CAP': 20,

'CAPSLOCK': 20,

'DEL': 46,

'DELETE': 46,

'DOWN': 40,

'END': 35,

'ENTER': 13,

'ESC': 27,

'HELP': 47,

'HOME': 36,

'INS': 45,

'INSERT': 45,

'LEFT': 37,

'LWIN': 91,

'NUMLOCK': 144,

'PGDN': 34,

'PGUP': 33,

'PRTSC': 44,

'RIGHT': 39,

'RMENU': 165,

'RWIN': 92,

'SCROLLLOCK': 145,

'SPACE': 32,

'TAB': 9,

'UP': 38,

'DOWN': 40,

'BACKSPACE': 8,

'F1': 112,

'F2': 113,

'F3': 114,

'F4': 115,

'F5': 116,

'F6': 117,

'F7': 118,

'F8': 119,

'F9': 120,

'F10': 121,

'F11': 122,

'F12': 123,

'F13': 124,

'F14': 125,

'F15': 126,

'F16': 127,

'F17': 128,

'F18': 129,

'F19': 130,

'F20': 131,

'F21': 132,

'F22': 133,

'F23': 134,

'F24': 135,

}

我就是不知道怎么用!特别是我想能够退格。

非常感谢你提前!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值