Skip to content

Commit

Permalink
Merge pull request #41 from sibson/special-keys
Browse files Browse the repository at this point in the history
--force-caps works with special keys, fixes #26
  • Loading branch information
sibson committed Mar 26, 2015
2 parents 0839194 + 9ad451e commit 754de3a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vncdotool/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,16 @@ class VNCDoToolClient(rfb.RFBClient):
cursor = None
cmask = None

SPECIAL_KEYS_US = "~!@#$%^&*()_+{}|:\"<>?"

def connectionMade(self):
rfb.RFBClient.connectionMade(self)
self.transport.setTcpNoDelay(True)

def _decodeKey(self, key):
if self.factory.force_caps and key.isupper():
key = 'shift-%c' % key
if self.factory.force_caps:
if key.isupper() or key in self.SPECIAL_KEYS_US:
key = 'shift-%c' % key

if len(key) == 1:
keys = [key]
Expand Down

0 comments on commit 754de3a

Please sign in to comment.