Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRTL Left+Key doesn't work on Windows #14

Open
crile opened this issue Apr 30, 2020 · 6 comments
Open

CRTL Left+Key doesn't work on Windows #14

crile opened this issue Apr 30, 2020 · 6 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@crile
Copy link

crile commented Apr 30, 2020

Hi,

It seems that the key combination, CTRL+key is not record. Or it is not replay.
I don't know if there is any log or output that I can provide to help.

Thanks

Version : atbswp 0.1
Env : Windows 10
Python : 3.7.4

@RMPR
Copy link
Owner

RMPR commented Apr 30, 2020

Thanks for reporting this bug, can you provide more details? (Which key?), steps to reproduce?

@RMPR
Copy link
Owner

RMPR commented Apr 30, 2020

Additionally if you didn't input something sensible like a password or whatever, you can post the file %TMP%\atbswp-20200430

@crile
Copy link
Author

crile commented May 4, 2020

Hi,

Steps to reproduce:

  • Ctrl+c to copy text
  • Ctrl+v to paste text

However, it seems that it is not supported, extract of atbswp temporary file:

    #!/bin/env python3
    # Created by atbswp (https://github.com/rmpr/atbswp)
    # on 04 May 2020 
    import pyautogui
    import time
    pyautogui.FAILSAFE = False

    pyautogui.moveTo(1492, 429)
    pyautogui.mouseDown(326, 243, 'left')
    pyautogui.mouseUp(326, 243, 'left')
    pyautogui.mouseDown(326, 242, 'left')
    pyautogui.mouseUp(214, 237, 'left')
    ### Key.ctrl_l is not supported yet
    pyautogui.keyDown('\x03')
    pyautogui.mouseDown(460, 279, 'left')
    pyautogui.mouseUp(460, 279, 'left')
    pyautogui.keyDown('enter')
    pyautogui.keyUp('enter')
    ### Key.ctrl_l is not supported yet
    pyautogui.keyDown('\x16')

@RMPR
Copy link
Owner

RMPR commented May 4, 2020

Will take a look at this,
What happens when you use right Ctrl instead?

@Nivekiba
Copy link
Collaborator

Nivekiba commented May 4, 2020

Probably the Ctrl key that doesn't work

@RMPR RMPR changed the title CRTL+Key doesn't work CRTL Left+Key doesn't work on Windows May 4, 2020
@RMPR RMPR added the bug Something isn't working label May 12, 2020
@RMPR RMPR added the good first issue Good for newcomers label Jan 13, 2023
@leomm20
Copy link

leomm20 commented Jun 15, 2023

It isn't a bug, just not implemented yet!

"Note that in the context of keyboard handling, the \x03 keycode may be associated with the Ctrl+C key, since Ctrl+C is often used to send an interrupt signal (SIGINT) on Unix and Windows systems to stop. the execution of a program."

Possible solution, in Win10 at least:

You can't do Ctrl+C and Ctrl+V in Windows. atbswp takes them like "### This key is not supported yet".
I managed that with this:

on_press:

try:
    if key.char == '\x03':
        self._capture.append("pyautogui.hotkey('ctrl', 'c')")
    elif key.char == '\x16':
        self._capture.append("pyautogui.hotkey('ctrl', 'v')")
    else:
        self.write_keyboard_action(move='keyDown', key=key.char)

except AttributeError:
    self.write_keyboard_action(move="keyDown", key=LOOKUP_SPECIAL_KEY.get(key, self._error))

on_release:

    if len(str(key)) <= 3:
        self.write_keyboard_action(move='keyUp', key=key)
    else:
        if hasattr(key, 'char') and (key.char == '\x03' or key.char == '\x16'):
            pass
        else:
            self.write_keyboard_action(move="keyUp", key=LOOKUP_SPECIAL_KEY.get(key, self._error))

I don't know if works in other OS, in Windows 10, yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants