1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-10 06:16:27 -05:00
OpenDiablo2/d2core/d2term/d2term.go
dk 62b8a610c0
D2input abstraction (#532)
* abstract d2input manager/service/events/keys/buttons to interface

* abstract d2input manager/service/events/keys/buttons to interface

* fixing lint error
2020-07-03 15:09:16 -04:00

21 lines
442 B
Go

package d2term
import (
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2interface"
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2input"
)
// Initialize creates and initializes the terminal
func Initialize() (d2interface.Terminal, error) {
term, err := createTerminal()
if err != nil {
return nil, err
}
if err := d2input.BindHandlerWithPriority(term, d2interface.PriorityHigh); err != nil {
return nil, err
}
return term, nil
}