andlabs / andlabs/libui

Key Location

オープン
#539 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C
スター
10.9k
フォーク
612
PR マージ指標
30日以内にマージされた PR はありません

説明

I noticed that keyLocation is not part of AreaKeyEvent. It is basically the indicator of whether the user pressed the right shift key or left shift key. Alternatively, it indicates if the user pressed a num pad number of a standard number.

SWT supports it: https://help.eclipse.org/latest/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/events/KeyEvent.html

Web Browser JS supports it too: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/location

By the way, I needed the keyLocation to make a distinction between right and left shift (or control) keys while playing [Glimmer Tetris](https://github.com/AndyObtiva/glimmer-dsl-libui/blob/28396dedb0d3ec4213ac94d20f922c36f13c11a6/examples/tetris.rb). For now, I resorted to another solution (make shift turn right and control turn left).

![Screen Shot 2021-11-03 at 1 26 02 PM](https://user-images.githubusercontent.com/23052/140165011-a86b1945-692a-4aaf-8577-a05a69bc173d.png)

Thanks for providing such a great GUI library.

Cheers.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。