Skip to content

Commit

Permalink
Merge pull request #7 from TheBdouilleur/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
TheBdouilleur authored May 31, 2020
2 parents 99f1b92 + eb974aa commit 6c204e9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
5 changes: 2 additions & 3 deletions bangs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ def autoComplete(characterList):

'''2. Keyboard shortcut handling'''
currentCharList = [] #

specialKeys = [specialKey for specialKey in keyboard.Key]
def on_press(key):
global currentCharList

#FIXME: Currently every keys pressed after ! are included in currentCharList
if (key == keyboard.KeyCode.from_char('!')) or (currentCharList and not key == keyboard.Key.space): # Check if: key is !, key follows !, key isn't a space
if key not in specialKeys and not key == keyboard.Key.space: # Check if: key is !, key follows !, key isn't a space
currentCharList.append(str(key).strip("'")) # Without this, key looks like this '"key"'

elif key == keyboard.Key.space and currentCharList:
Expand Down
12 changes: 7 additions & 5 deletions settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"bangs":{
"!g":"https://google.com/search?q=",
"!@":"[email protected]"
}
}
"bangs": {
"!g": "https://google.com/search?q=",
"!@": "[email protected]",
"pwd": "myverylongpassword"
}
}

3 changes: 3 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
currentList = list()
if currentList:
print(currentList)

0 comments on commit 6c204e9

Please sign in to comment.