first implementation of clippy

This commit is contained in:
Christopher Talib 2019-12-19 16:26:14 +01:00
parent 1d3c16cd7b
commit 5f2f4b62a2
3 changed files with 19 additions and 3 deletions

View file

@ -1,7 +1,6 @@
package ai
import (
"fmt"
"regexp"
"strings"
@ -19,11 +18,12 @@ func ReadFromStream(inputChan chan utils.InputEvent) {
switch b.String() {
case b.String():
if findPassword(b.String()) {
fmt.Println("I LIKE YOUR PASSWORD")
utils.ClippySays("I LIKE YOUR PASSWORD")
b.Reset()
}
if findLove(b.String()) {
fmt.Println("I love you too...")
utils.ClippySays("I love you too...")
b.Reset()
}
default:

View file

@ -114,6 +114,8 @@ func (k *KeyLogger) Close() error {
func main() {
fmt.Println("Your keyboard input will be here: ", getKeyboard())
utils.ClippySays("i am here to help")
// TODO
// !) get streaming data from keyboard
// 2 unpackage the data to be human readable

View file

@ -1,6 +1,7 @@
package utils
import (
"fmt"
"syscall"
"unsafe"
)
@ -154,3 +155,16 @@ func (i *InputEvent) KeyPress() bool {
func (i *InputEvent) KeyRelease() bool {
return i.Value == 0
}
func ClippySays(what string) {
clippy := fmt.Sprintf(` __
/ \
| | /
@ @ | %s
|| || |
|| || <--|
|\_/| |
\___/ \`, what)
fmt.Printf("%s", clippy)
}