dmK.py 551 B

123456789101112131415161718
  1. #from __future__ import unicode_literals
  2. # -*- coding: utf-8 -*-
  3. """gestion des raccourcis claviers"""
  4. from PyQt4.QtCore import *
  5. from PyQt4.QtGui import *
  6. def touchesEnfoncees():
  7. """renvoie la/les touche(s) clavier actuellement enfoncee(s)"""
  8. retour = []
  9. touches = QApplication.keyboardModifiers()
  10. if touches == Qt.ShiftModifier:
  11. retour = ["maj"]
  12. elif touches == Qt.ControlModifier:
  13. retour = ["ctrl"]
  14. elif touches == (Qt.ControlModifier | Qt.ShiftModifier):
  15. retour = ["ctrl", "maj"]
  16. return retour