Commit 22d240b02e61c912824e171a90a2227e8c9a574c
- Diff rendering mode:
- inline
- side by side
lib/sup/textfield.rb
(6 / 6)
|   | |||
| 107 | 107 | Ncurses::Form::REQ_DEL_CHAR | |
| 108 | 108 | when Ncurses::KEY_BACKSPACE, 127 # 127 is also a backspace keysym | |
| 109 | 109 | Ncurses::Form::REQ_DEL_PREV | |
| 110 | when ?\C-a, Ncurses::KEY_HOME | ||
| 110 | when ?\C-a.ord, Ncurses::KEY_HOME | ||
| 111 | 111 | nop | |
| 112 | 112 | Ncurses::Form::REQ_BEG_FIELD | |
| 113 | when ?\C-e, Ncurses::KEY_END | ||
| 113 | when ?\C-e.ord, Ncurses::KEY_END | ||
| 114 | 114 | Ncurses::Form::REQ_END_FIELD | |
| 115 | when ?\C-k | ||
| 115 | when ?\C-k.ord | ||
| 116 | 116 | Ncurses::Form::REQ_CLR_EOF | |
| 117 | when ?\C-u | ||
| 117 | when ?\C-u.ord | ||
| 118 | 118 | set_cursed_value cursed_value_after_point | |
| 119 | 119 | Ncurses::Form.form_driver @form, Ncurses::Form::REQ_END_FIELD | |
| 120 | 120 | nop | |
| 121 | 121 | Ncurses::Form::REQ_BEG_FIELD | |
| 122 | when ?\C-w | ||
| 122 | when ?\C-w.ord | ||
| 123 | 123 | Ncurses::Form.form_driver @form, Ncurses::Form::REQ_PREV_CHAR | |
| 124 | 124 | Ncurses::Form.form_driver @form, Ncurses::Form::REQ_DEL_WORD | |
| 125 | 125 | when Ncurses::KEY_UP, Ncurses::KEY_DOWN | |
| … | … | ||
| 179 | 179 | ## this is almost certainly unnecessary, but it's the only way | |
| 180 | 180 | ## i could get ncurses to remember my form's value | |
| 181 | 181 | def nop | |
| 182 | Ncurses::Form.form_driver @form, " "[0] | ||
| 182 | Ncurses::Form.form_driver @form, " ".ord | ||
| 183 | 183 | Ncurses::Form.form_driver @form, Ncurses::Form::REQ_DEL_PREV | |
| 184 | 184 | end | |
| 185 | 185 | end |

