Skip to content

Commit

Permalink
feat/docs: remove keyboard.write
Browse files Browse the repository at this point in the history
- This is removed because it is very reliant on the current selected keyboard layout. For example, writing `@` may work fine on the US keyboard layout but not on the UK keyboard layout
  • Loading branch information
winstxnhdw committed Jul 3, 2024
1 parent 81357fa commit eef3e80
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 382 deletions.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ keyboard.press(0x0D)
keyboard.press(0x5B, 0x44)
```

#### String Inputs

`KeyWin` can also convert strings to key codes, albeit at a slight performance cost.

```python
from keywin import keyboard

keyboard.write('Hello World!')
```

### Mouse

Similar to the keyboard, `KeyWin` provides a low-level API for mouse inputs based on Microsoft's [MOUSEINPUT](https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-mouseinput) structure.
Expand Down
18 changes: 0 additions & 18 deletions keywin/keyboard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from keywin.keyboard.utils import convert_to_key_code
from keywin.send_input import press_keyboard


Expand All @@ -17,20 +16,3 @@ def press(*keys: int) -> bool:
success (bool) : the success of the event
"""
return press_keyboard(keys)


def write(string: str) -> list[bool]:
"""
Summary
-------
high-level function to type a string
Parameters
----------
string (str) : string to type
Returns
-------
successes (list[bool]) : the success of the event(s)
"""
return [press(*key_codes) for key_codes in convert_to_key_code(string)]
289 changes: 0 additions & 289 deletions keywin/keyboard/codes/__init__.py

This file was deleted.

6 changes: 0 additions & 6 deletions keywin/keyboard/exceptions/__init__.py

This file was deleted.

3 changes: 0 additions & 3 deletions keywin/keyboard/utils/__init__.py

This file was deleted.

38 changes: 0 additions & 38 deletions keywin/keyboard/utils/convert_to_key_code.py

This file was deleted.

Loading

0 comments on commit eef3e80

Please sign in to comment.