Skip to content

Dynamically change keyboard position on keyset change #547

@Gingol

Description

@Gingol

Hi,
I would like to dynamically change the position of the keyboard when the keyset is changed.
I have this custom layout with three keyset:

layout: 'custom',
customLayout: {
	'meta_num': [
		'* / + -',
		'7 8 9 {b}',
		'4 5 6 .',
		'1 2 3 ,',
		'{meta_shift} 0 {normal} {e}'
	],
	'normal': [
		'q w e r t y u i o p {b}',
		'a s d f g h j k l {e}',
		'z x c v b n m , .',
		'{meta_shift} {space} {meta_num}'
	],
	'meta_shift': [
		'Q W E R T Y U I O P {b}',
		'A S D F G H J K L {e}',
		'Z X C V B N M ; :',
		'{normal} {space} {meta_num}'
	]
},

And this position settings:

reposition : true,
	position : {
		of : $("body"),
		my : 'center middle',
		at : 'center middle',
		at2: 'center bottom' // used when "usePreview" is false
},

The meta_num keyset is tighter than the other ones, so when the keyset changes the keyboard isn't centered but it's on the left (because the attributes "top" and "left" remain the same).
I would like an always-centered keyboards or alternatively the meta_num keyboard aligned on the right.
I already tried the redraw function but it didn't work.
I hope someone can help me.
Thanks in advance.

Mauro

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions