zoukankan      html  css  js  c++  java
  • SendKeys总结

    1.SendKeys中特殊字符的键代码
    BACKSPACE {BACKSPACE}、{BS} 或 {BKSP}

    BREAK {BREAK}

    CAPS LOCK {CAPSLOCK}
    DEL 或 DELETE {DELETE} 或 {DEL}
    DOWN ARROW(下箭头) {DOWN}
    END {END}
    ENTER {ENTER} 或 ~
    ESC {ESC}
    HELP {HELP}
    HOME {HOME}
    INS 或 INSERT {INSERT} 或 {INS}
    LEFT ARROW(左箭头) {LEFT}
    NUM LOCK {NUMLOCK}
    PAGE DOWN {PGDN}
    PAGE UP {PGUP}
    PRINT SCREEN {PRTSC}(保留,以备将来使用)
    RIGHT ARROW(右箭头) {RIGHT}
    SCROLL LOCK {SCROLLLOCK}
    TAB {TAB}
    UP ARROW(上箭头) {UP}
    F1 {F1}
    F2 {F2}
    F3 {F3}
    F4 {F4}
    F5 {F5}
    F6 {F6}
    F7 {F7}
    F8 {F8}
    F9 {F9}
    F10 {F10}
    F11 {F11}
    F12 {F12}
    F13 {F13}
    F14 {F14}
    F15 {F15}
    F16 {F16}
    数字盘加号 {ADD}
    数字盘减号 {SUBTRACT}
    数字盘乘号 {MULTIPLY}
    数字盘除号 {DIVIDE}

    2.如何输入空格空格

    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!"``
        """

     example:

     SendKeys.SendKeys('Hello Word!',0.05,True,True,True,True)

  • 相关阅读:
    php 转化整型需要注意的地方
    生成6位随机数
    php://input
    ios常见问题 经验之谈
    ios 从前台返回到回台 从后台返回到前台 或者 支付宝支付订单后 对界面进行操作
    ios根据文本自适应 然后 搭建类似如下效果
    iosTableView 局部全部刷新以及删除编辑操作
    ios打开系统自带APP
    iOS通过URL Scheme启动app(收集了常用的app的URL Scheme)
    ios UIApplocation 中APP启动方式
  • 原文地址:https://www.cnblogs.com/ybcao/p/5459814.html
Copyright © 2011-2022 走看看