mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/ui: stop panicking at Key.String
This commit is contained in:
parent
8e1bd4eaba
commit
e6346c01d2
@ -493,7 +493,7 @@ func (k Key) String() string {
|
|||||||
{{range $index, $name := .UIKeyNames}}case Key{{$name}}:
|
{{range $index, $name := .UIKeyNames}}case Key{{$name}}:
|
||||||
return {{$name | printf "Key%s" | printf "%q"}}
|
return {{$name | printf "Key%s" | printf "%q"}}
|
||||||
{{end}}}
|
{{end}}}
|
||||||
panic(fmt.Sprintf("ui: invalid key: %d", k))
|
return fmt.Sprintf("Key(%d)", k)
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
@ -348,5 +348,5 @@ func (k Key) String() string {
|
|||||||
case KeyTab:
|
case KeyTab:
|
||||||
return "KeyTab"
|
return "KeyTab"
|
||||||
}
|
}
|
||||||
panic(fmt.Sprintf("ui: invalid key: %d", k))
|
return fmt.Sprintf("Key(%d)", k)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user