![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
add programs
keyboardButton.cpp@1:05875edbf215, 2019-05-01 (annotated)
- Committer:
- yabutakefu
- Date:
- Wed May 01 05:37:42 2019 +0000
- Revision:
- 1:05875edbf215
- Parent:
- 0:965ed9ce2a09
test commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yabutakefu | 0:965ed9ce2a09 | 1 | #include "keyboardButton.h" |
yabutakefu | 0:965ed9ce2a09 | 2 | |
yabutakefu | 0:965ed9ce2a09 | 3 | /* |
yabutakefu | 0:965ed9ce2a09 | 4 | 試作版キーボード 日本語53キー版 クラス |
yabutakefu | 0:965ed9ce2a09 | 5 | */ |
yabutakefu | 0:965ed9ce2a09 | 6 | |
yabutakefu | 0:965ed9ce2a09 | 7 | keyboardButton::keyboardButton(int keycode, bool push) |
yabutakefu | 0:965ed9ce2a09 | 8 | { |
yabutakefu | 0:965ed9ce2a09 | 9 | _keycode = keycode; |
yabutakefu | 0:965ed9ce2a09 | 10 | _push = push; |
yabutakefu | 0:965ed9ce2a09 | 11 | } |
yabutakefu | 0:965ed9ce2a09 | 12 | |
yabutakefu | 0:965ed9ce2a09 | 13 | keyboardButton::~keyboardButton() |
yabutakefu | 0:965ed9ce2a09 | 14 | { |
yabutakefu | 0:965ed9ce2a09 | 15 | } |
yabutakefu | 0:965ed9ce2a09 | 16 | |
yabutakefu | 0:965ed9ce2a09 | 17 | //キー押下状態を設定する |
yabutakefu | 0:965ed9ce2a09 | 18 | void keyboardButton::set(bool push) { |
yabutakefu | 0:965ed9ce2a09 | 19 | _push = push; |
yabutakefu | 0:965ed9ce2a09 | 20 | } |
yabutakefu | 0:965ed9ce2a09 | 21 | |
yabutakefu | 0:965ed9ce2a09 | 22 | //キー押下状態を取得する |
yabutakefu | 0:965ed9ce2a09 | 23 | bool keyboardButton::press(void) { |
yabutakefu | 0:965ed9ce2a09 | 24 | return _push; |
yabutakefu | 0:965ed9ce2a09 | 25 | } |
yabutakefu | 0:965ed9ce2a09 | 26 | |
yabutakefu | 0:965ed9ce2a09 | 27 | //割り当てキーボードコードを取得する |
yabutakefu | 0:965ed9ce2a09 | 28 | int keyboardButton::code(void) { |
yabutakefu | 0:965ed9ce2a09 | 29 | return _keycode; |
yabutakefu | 0:965ed9ce2a09 | 30 | } |