Support alternative keyboard layouts

This commit is contained in:
Liam Galvin 2018-11-30 21:35:00 +00:00
parent 4c3024d51c
commit 656bf89583
1 changed files with 7 additions and 7 deletions

View File

@ -14,14 +14,14 @@ func TestKeyCombinations(t *testing.T) {
require.Nil(t, err)
require.NotNil(t, combi)
assert.Equal(t, glfw.KeyA, combi.key)
assert.Equal(t, 'a', combi.char)
assert.Equal(t, glfw.ModControl+glfw.ModAlt, combi.mods)
assert.True(t, combi.Match(glfw.ModControl^glfw.ModAlt, glfw.KeyA))
assert.False(t, combi.Match(glfw.ModControl^glfw.ModAlt, glfw.KeyB))
assert.False(t, combi.Match(glfw.ModControl, glfw.KeyA))
assert.False(t, combi.Match(glfw.ModAlt, glfw.KeyA))
assert.False(t, combi.Match(0, glfw.KeyA))
assert.False(t, combi.Match(glfw.ModControl^glfw.ModAlt^glfw.ModShift, glfw.KeyA))
assert.True(t, combi.Match(glfw.ModControl^glfw.ModAlt, 'a'))
assert.False(t, combi.Match(glfw.ModControl^glfw.ModAlt, 'b'))
assert.False(t, combi.Match(glfw.ModControl, 'b'))
assert.False(t, combi.Match(glfw.ModAlt, 'd'))
assert.False(t, combi.Match(0, 'e'))
assert.False(t, combi.Match(glfw.ModControl^glfw.ModAlt^glfw.ModShift, 'f'))
}