Handle keypress events as well

keydown is not enough, because browsers. A (very very very) long
explanation that I read in part is at http://unixpapa.com/js/key.html

E.g. on my keyboard layout (neo2), I don't get a keydown event for alt+<,
which in QWERTY keys is alt + caps lock + u (or the key above shift next to
enter on the right side, which actually isn't present on QWERTY (not ' but to
the right of it - it's not there on a US layout, but it is # on QWERTZ). I do get
a keypress event though.
This commit is contained in:
Lorenz Hübschle-Schneider 2014-08-10 16:57:58 +01:00
parent 9e0e3d06ae
commit 64f412e047

View file

@ -29,7 +29,7 @@
<script type="text/javascript" src="js/plugins.js"></script>
<script type="text/javascript" src="3rdparty/favico-0.3.4-mod.min.js"></script>
</head>
<body ng-controller="WeechatCtrl" ng-keydown="handleKeyPress($event)" ng-class="{'no-overflow': connected}" lang="en-US">
<body ng-controller="WeechatCtrl" ng-keydown="handleKeyPress($event)" ng-keypress="handleKeyPress($event)" ng-class="{'no-overflow': connected}" lang="en-US">
<div ng-hide="connected" class="container">
<h2>
<img alt="logo" src="assets/img/glowing-bear.svg">