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

feat: Write out emojis to system instead of copying #7

Merged
merged 3 commits into from Jul 7, 2021

Conversation

tomershvueli
Copy link
Contributor

This addresses feature request #6.

  • Brought in RobotJS
  • Refactored main functionality so that when a user clicks or hits 'enter' on a specific emoji, it will immediately close the window and type out the selected emoji to the system

This is a major chance of functionality so I will leave it to @virejdasani if they want Geniemoji to go in this direction.

Note that RobotJS seems to require explicit permissions on macOS. When the user first will run this application, a pop up will appear that will require them to give Geniemoji permissions in order to type on the user's behalf. See below images:
image
image

See functionality in action below:
Geniemoji with keys

@virejdasani
Copy link
Owner

Hi, thanks a bunch! This looks amazing! Before I go ahead with the merge, I have to ask, does this work as expected on Windows and Linux? Btw, if you don't have access to those operating systems, let me know and I'll test it 👍

@tomershvueli
Copy link
Contributor Author

@virejdasani I only have Macs so would appreciate you testing this on the other OS'es :)

@virejdasani
Copy link
Owner

Sure thing, I'll test it :)

@tomershvueli
Copy link
Contributor Author

@virejdasani any thoughts or updates on this?

@virejdasani
Copy link
Owner

virejdasani commented Jul 2, 2021

@tomershvueli, I'm sorry for getting back to you this late, I've been quite busy with school.
The last time I tried to install write-moji on my mac with npm install, it gave a few errors which were fixed when I installed it by typing npm i -D electron-rebuild. It worked perfectly. However, today when I tried to install it on my Windows VM, it gave the same errors; so I tried to npm i -D electron-rebuild on windows too, however, this didn't resolve the errors so I tried to reinstall write-moji on my mac and now the write emoji feature isn't working
I screen recorded this:
https://streamable.com/izd4ud
Any idea what's going wrong?

@tomershvueli
Copy link
Contributor Author

@virejdasani no worries, school and studies definitely comes first :)

From the screen capture it looks like you might be on the master branch, where as I pushed up the new code to the write-moji branch. Try checking that branch out, pulling, npm installing, and run again.

@virejdasani
Copy link
Owner

virejdasani commented Jul 2, 2021

Oh yea, I see what I did there, my bad 😅
After downloading the write-moji branch, it's still throwing an error:
https://streamable.com/hzahut
It is throwing the same error on Windows too

@tomershvueli
Copy link
Contributor Author

Weird.. that same npm i -D electron-rebuild command worked for me (sorry about the install the first time, I can push up the cleaned package-lock.json). I'm wondering if maybe the documentation can help you push through that error?

@virejdasani
Copy link
Owner

Still no luck. Let me try and find another way 👍

@virejdasani
Copy link
Owner

For some reason, there are errors when installing RobotJS. After some research, I found that there are other people who have raised this issue on their GitHub but it hasn't been resolved yet. Furthermore, I've tested it on Linux and the install fails on there too.
I started looking for alternatives to RobotJS and found this: https://www.npmjs.com/package/node-key-sender
I think it may be worth looking into :)

@tomershvueli
Copy link
Contributor Author

@virejdasani RobotJS definitely presented some issues. However, this node-key-sender, while also looks like it'll get us what we want, introduces Java into the mix, since the package just seems to be a wrapper around a Java jar file - are you ok with that? If so, I can try to switch out RobotJS for this node-key-sender!

@virejdasani
Copy link
Owner

@tomershvueli, I think node-key-sender is the way to go, for this feature, because RobotJS is getting us nowhere

@tomershvueli
Copy link
Contributor Author

@virejdasani I appreciate the decisiveness! I gave node-key-sender a whirl but it seems it's not working on my Mac :( it opens up a Java application, but in the foreground, meaning any 'typing' it does does not actually get transferred to the window the user intended it. See screenshot:
image
I believe we are seeing the behavior described in this issue. Unfortunately it looks like both RobotJS and node-key-sender aren't maintained anymore 😢
If you want to play around with it some, I pushed up the code to a new node-key-sender branch here.

@virejdasani
Copy link
Owner

It sucks that this didn't work out. I'll try to play around with the code or find a new library or try getting RobotJS working. Either way, I'll keep you posted 👍

@virejdasani virejdasani added the help wanted Extra attention is needed label Jul 5, 2021
@tomershvueli
Copy link
Contributor Author

Thanks @virejdasani, let me know if I can help in any other way!

@virejdasani
Copy link
Owner

virejdasani commented Jul 6, 2021

@tomershvueli, I finally have some good news. After a little research, I found that when you upgrade or downgrade your MacOS version, the Xcode command line tools have to be reinstalled or they are undiscoverable. I had just downgraded from Monterey Beta back to Big Sur. After reinstalling the tools, I tried reinstalling write-moji and now it works!
RobotJS is now installing without any errors.
I showed the write-moji version to my parents and my mom said "what if someone wants to write the same emoji multiple times?"
So, before I merge, can you make it so that when your press ctrl + enter it copies the emoji, and when you press enter, it writes it?

@tomershvueli
Copy link
Contributor Author

@virejdasani neat idea! I just pushed up a commit that will allow a user to copy the emoji if they select an emoji while holding down a Shift key instead of Control. The reason is that this is very easy to detect in JS, so the change is relatively trivial. Let me know your thoughts!

@virejdasani
Copy link
Owner

This works perfectly!
I still wasn't able to get it to install on Windows and Linux via npm so I'll try to build the executable and try it before I go ahead with the merge 👍

@virejdasani virejdasani added Feature New feature and removed help wanted Extra attention is needed labels Jul 7, 2021
@virejdasani
Copy link
Owner

Bad news, still doesn't work on Windows or Linux:
IMG_20210707_105921
Anyway, I'm going to have a new branch exclusive for MacOS with this feature.

@virejdasani
Copy link
Owner

virejdasani commented Jul 7, 2021

@tomershvueli, I have created a new branch from the master called macos. Can you make it so that when I merge your pr, it doesn't change the master branch and becomes the macos branch?

@tomershvueli
Copy link
Contributor Author

@virejdasani, see PR #9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants