Comments (1)
Глобальных горячих клавиш не предусмотрено. Можно попробовать задать OnKeyDown для конкретного Window. Наверное, при одном окне будет как глобальное. Часть контролов определяют вдобавок OnKeyPress - тут кроме кода клавиши/комбинации ещё приходит печатный символ. Полезно для Edit/ListBox/Table, чтобы фильтровать нажатое пользователем. В целом, OnKeyDown получает системный код клавиши или комбинации клавиши: и нажатие на букву и нажатие буква+Ctrl каждое сгенерирует свой собственный уникальный код. По нему не выйдет однозначно получить букву(скажем, и для латиницы и для кирилицы код придёт один, но буквы-то должны печататься разные). Именно поэтому, контролы, которые нуждаются в конкретной нажатой букве реализуют ещё и OnKeyPress. Какие комбинации клавиш поддерживаются(а поддерживаются не все варианты комбинаций), можно глянуть в библиотеке nsf/termbox-go
, в файле api_common.go
.
Конкретно для OnKeyDown примеров вроде нет. Но работа с ним практически ничем не отличается от OnKeyPress. А для OnKeyPress есть неколько примеров. Первый: в главном демо maindemo
для поля ввода обрабатывается нажатие на Enter, чтобы изменить положение ProgressBar и обновить выбранный элемент в выпадающем списке. Так же, можно глянуть fileselectdlg.go
: там несколько разных обработчиков реализовано.
from clui.
Related Issues (20)
- Unable to edit table HOT 2
- Popup/new windows seems to tear, quickly disappear/reappear, and go off frame occasionally for fraction of second when clcking on moving it. HOT 2
- Another question about editing database fields HOT 2
- Display formatted text? HOT 4
- Example of "Add new row"? HOT 12
- I tried to create a pull request, but it was not working properly. HOT 1
- Explicitly place cursor in field so it is ready to begin typing? HOT 2
- Please create the 1.2.1 release HOT 1
- Cant get button to be black HOT 1
- [Question] OnClick() event for base_control? HOT 3
- Menu Implementation HOT 5
- Optimal TableView Real State Management HOT 3
- Window Borders HOT 2
- Missing OnActivate() HOT 2
- Change bg color after selection[TableView] HOT 5
- What is the correct way to redraw a control? HOT 1
- Name of widget HOT 1
- horizontal scrollbar HOT 3
- Autosized labels incorrectly sized
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clui.