Skip to content

Commit

Permalink
Added a log entry when the game first send a message
Browse files Browse the repository at this point in the history
  • Loading branch information
nickolaj-jepsen committed Jan 26, 2016
1 parent 4f662cb commit 67c063d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cue_csgo/csgo.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def set_led_color(self, key_id, color):

class CueCSGO(object):
store = {}
first_connection = False

def __init__(self, debug=False, settings=None):

Expand Down Expand Up @@ -73,6 +74,9 @@ def index():

@app.route('/post', methods=["POST"])
def post():
if not self.first_connection:
logging.info("First message from CS:GO received")
self.first_connection = True
self.store = request.get_json()
return ''

Expand Down
2 changes: 2 additions & 0 deletions etc/draw_keyboard.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from PIL import Image, ImageDraw, ImageFont

# Corsair k70 RGB Nordic
keys = {1: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 7.0}, 2: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 38.0}, 3: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 57.0}, 4: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 76.0}, 5: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 95.0}, 6: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 127.0}, 7: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 146.0}, 8: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 165.0}, 9: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 183.0}, 10: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 215.0}, 11: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 234.0}, 12: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 254.0}, 13: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 7.0}, 14: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 25.0}, 15: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 45.0}, 16: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 64.0}, 17: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 82.0}, 18: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 101.0}, 19: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 121.0}, 20: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 140.0}, 21: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 158.0}, 22: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 178.0}, 23: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 197.0}, 24: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 215.0}, 25: {'height': 13.0, 'top': 69.0, 'width': 21.0, 'left': 7.0}, 26: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 35.0}, 27: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 54.0}, 28: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 73.0}, 29: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 92.0}, 30: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 111.0}, 31: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 130.0}, 32: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 148.0}, 33: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 168.0}, 34: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 187.0}, 35: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 206.0}, 36: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 225.0}, 37: {'height': 13.0, 'top': 88.0, 'width': 26.0, 'left': 7.0}, 38: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 39.0}, 39: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 58.0}, 40: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 77.0}, 41: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 96.0}, 42: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 116.0}, 43: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 134.0}, 44: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 153.0}, 45: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 173.0}, 46: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 192.0}, 47: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 210.0}, 48: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 229.0}, 49: {'height': 13.0, 'top': 106.0, 'width': 18.0, 'left': 7.0}, 50: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 31.0}, 51: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 49.0}, 52: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 68.0}, 53: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 87.0}, 54: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 106.0}, 55: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 124.0}, 56: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 144.0}, 57: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 162.0}, 58: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 181.0}, 59: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 200.0}, 60: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 219.0}, 61: {'height': 13.0, 'top': 126.0, 'width': 21.0, 'left': 7.0}, 62: {'height': 13.0, 'top': 126.0, 'width': 13.0, 'left': 35.0}, 63: {'height': 13.0, 'top': 126.0, 'width': 17.0, 'left': 54.0}, 65: {'height': 13.0, 'top': 126.0, 'width': 118.0, 'left': 77.0}, 68: {'height': 13.0, 'top': 126.0, 'width': 17.0, 'left': 202.0}, 69: {'height': 13.0, 'top': 126.0, 'width': 13.0, 'left': 225.0}, 70: {'height': 13.0, 'top': 126.0, 'width': 13.0, 'left': 244.0}, 72: {'height': 9.0, 'top': 7.0, 'width': 9.0, 'left': 299.0}, 73: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 271.0}, 74: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 296.0}, 75: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 315.0}, 76: {'height': 13.0, 'top': 29.0, 'width': 13.0, 'left': 334.0}, 77: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 296.0}, 78: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 315.0}, 79: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 334.0}, 80: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 243.0}, 82: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 248.0}, 83: {'height': 32.0, 'top': 69.0, 'width': 21.0, 'left': 264.0}, 85: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 234.0}, 87: {'height': 13.0, 'top': 50.0, 'width': 31.0, 'left': 253.0}, 88: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 296.0}, 89: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 315.0}, 90: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 334.0}, 91: {'height': 13.0, 'top': 106.0, 'width': 45.0, 'left': 239.0}, 92: {'height': 13.0, 'top': 126.0, 'width': 21.0, 'left': 263.0}, 93: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 315.0}, 94: {'height': 13.0, 'top': 126.0, 'width': 13.0, 'left': 296.0}, 95: {'height': 13.0, 'top': 126.0, 'width': 13.0, 'left': 315.0}, 96: {'height': 13.0, 'top': 126.0, 'width': 13.0, 'left': 334.0}, 97: {'height': 9.0, 'top': 7.0, 'width': 9.0, 'left': 318.0}, 98: {'height': 11.0, 'top': 6.0, 'width': 19.0, 'left': 375.0}, 99: {'height': 11.0, 'top': 29.0, 'width': 17.0, 'left': 357.0}, 100: {'height': 11.0, 'top': 29.0, 'width': 19.0, 'left': 375.0}, 101: {'height': 11.0, 'top': 29.0, 'width': 17.0, 'left': 394.0}, 102: {'height': 11.0, 'top': 29.0, 'width': 18.0, 'left': 412.0}, 103: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 359.0}, 104: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 377.0}, 105: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 396.0}, 106: {'height': 13.0, 'top': 50.0, 'width': 13.0, 'left': 415.0}, 107: {'height': 32.0, 'top': 69.0, 'width': 13.0, 'left': 415.0}, 108: {'height': 32.0, 'top': 106.0, 'width': 13.0, 'left': 415.0}, 109: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 359.0}, 110: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 377.0}, 111: {'height': 13.0, 'top': 69.0, 'width': 13.0, 'left': 396.0}, 113: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 359.0}, 114: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 377.0}, 115: {'height': 13.0, 'top': 88.0, 'width': 13.0, 'left': 396.0}, 116: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 359.0}, 117: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 377.0}, 118: {'height': 13.0, 'top': 106.0, 'width': 13.0, 'left': 396.0}, 119: {'height': 13.0, 'top': 126.0, 'width': 31.0, 'left': 359.0}, 120: {'height': 13.0, 'top': 126.0, 'width': 13.0, 'left': 396.0}}


im = Image.new('RGBA', (2000, 1000), (255, 255, 255, 0))
draw = ImageDraw.Draw(im)
font = ImageFont.truetype("arial.ttf", 20)
Expand Down

0 comments on commit 67c063d

Please sign in to comment.