I have a XUL button that once clicked listens for a keystroke. When a keystroke is captured, it sets the label of the button to the keyCode of the keystroke. I want to save this value to the preferences. I am using onsynctopreference to tell the button to use the value of its label as the preference. However, onsynctopreference seems to fire onmouseup. The problem is, the user is expected to click the button, then enter a key. Once the key is entered, then I want onsynctopreference to fire.
How would you suggest I handle this? Is there anyway to manually call onsynctopreference?