Skip to content

Commit

Permalink
add console spy feature alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
spyoungtech committed Apr 10, 2020
1 parent 0b04a69 commit fbac689
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions ahk/console_spy.py
@@ -0,0 +1,16 @@
from ahk import AHK
from ahk.window import Window
from ahk.directives import NoTrayIcon


def _console_spy(*args, **kwargs):
ahk = AHK(directives={NoTrayIcon})

while True:
position = ahk.mouse_position
window = Window.from_mouse_position(engine=ahk)
color = ahk.pixel_get_color(*position)
print(f'Mouse Position: {position} Pixel Color: {color} Window Title: {window.title} ', end='\r')

def _main():
_console_spy()
5 changes: 4 additions & 1 deletion setup.py
Expand Up @@ -30,5 +30,8 @@
],
tests_require=test_requirements,
include_package_data=True,
zip_safe=False
zip_safe=False,
entry_points={
'console_scripts': ['console_spy = ahk.console_spy:_main']
}
)

0 comments on commit fbac689

Please sign in to comment.