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

WIP: Add multiline support #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Commits on Dec 16, 2019

  1. WIP: Add multiline support

    This will allow you to press shift + enter by maintaining a queue of 2 keycodes from last pressed keys.
    
    I had to use `iohook` library to be able to capture JUST shift key presses. I did not take a ton of time to set it up properly, so it does not teardown listener and has a memory leak.
    
    Also, I cant get the evaluate to work properly with multiline, but this is a good start I think.
    
    ```ts
    		ioHook.on('keypress', (event: IOHookEvent) => {
    			if (lastKeys.length < 2) lastKeys.push(event)
    		          else {
    				lastKeys.pop()
    				lastKeys.unshift(event)
    			}
    		});```
    ```ts
    			} else if (name === 'return') {
    				const lastKey = lastKeys.concat().pop()
    				if (lastKey!.shiftKey) {
    					stdout.write('\n')
    					rl.write('\n')
    				} else {
    ```
    GavinRay97 committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    269d0a7 View commit details
    Browse the repository at this point in the history