mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 06:37:14 +09:00
Raw event support with new tcell
This commit is contained in:
@@ -9,9 +9,9 @@ import (
|
||||
"unicode"
|
||||
|
||||
"github.com/flynn/json5"
|
||||
"github.com/zyedidia/tcell"
|
||||
"github.com/zyedidia/micro/internal/config"
|
||||
"github.com/zyedidia/micro/internal/screen"
|
||||
"github.com/zyedidia/tcell"
|
||||
)
|
||||
|
||||
func InitBindings() {
|
||||
@@ -83,6 +83,7 @@ modSearch:
|
||||
k = k[5:]
|
||||
modifiers |= tcell.ModShift
|
||||
case strings.HasPrefix(k, "\x1b"):
|
||||
screen.Screen.RegisterRawSeq(k)
|
||||
return RawEvent{
|
||||
esc: k,
|
||||
}, true
|
||||
|
||||
@@ -6,13 +6,13 @@ import (
|
||||
|
||||
luar "layeh.com/gopher-luar"
|
||||
|
||||
"github.com/zyedidia/tcell"
|
||||
lua "github.com/yuin/gopher-lua"
|
||||
"github.com/zyedidia/micro/internal/buffer"
|
||||
"github.com/zyedidia/micro/internal/config"
|
||||
"github.com/zyedidia/micro/internal/display"
|
||||
ulua "github.com/zyedidia/micro/internal/lua"
|
||||
"github.com/zyedidia/micro/internal/screen"
|
||||
"github.com/zyedidia/tcell"
|
||||
)
|
||||
|
||||
type BufKeyAction func(*BufPane) bool
|
||||
@@ -261,11 +261,11 @@ func (h *BufPane) HandleEvent(event tcell.Event) {
|
||||
}
|
||||
|
||||
switch e := event.(type) {
|
||||
// case *tcell.EventRaw:
|
||||
// re := RawEvent{
|
||||
// esc: e.EscSeq(),
|
||||
// }
|
||||
// h.DoKeyEvent(re)
|
||||
case *tcell.EventRaw:
|
||||
re := RawEvent{
|
||||
esc: e.EscSeq(),
|
||||
}
|
||||
h.DoKeyEvent(re)
|
||||
case *tcell.EventPaste:
|
||||
h.paste(e.Text())
|
||||
h.Relocate()
|
||||
|
||||
Reference in New Issue
Block a user