LibVlc in Go program
Posted: 17 Apr 2020 15:27
I wrote simple IPTV player in GoLang using LibVlc. The program catches keyboard events raised in main application (terminal window).
When the player works in fullscreen mode keyboard events are not raised. Is there any method to catch such events without creation parental OS window?
I need cross platform desicion if it possible. Is OS registered global hotkeys only way for solve the problem?
Used library: https://github.com/adrg/libvlc-go/blob/master/v3/examples/player.go - as sample player
https://github.com/eiannone/keyboard - for catching input events
When the player works in fullscreen mode keyboard events are not raised. Is there any method to catch such events without creation parental OS window?
I need cross platform desicion if it possible. Is OS registered global hotkeys only way for solve the problem?
Code: Select all
func (p *VlcPlayer) Run() {
go Input()
for {
select {
case command := <-p.Cmd:
https://github.com/eiannone/keyboard - for catching input events
Code: Select all
func Input() {
err := keyboard.Open()
if err != nil {
panic(err)
}
defer keyboard.Close()
fmt.Println("Press ESC to quit")