Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
Artur
Imagevue PowerPack
Topic Author
Posts: 510
Joined: 20 May 2011, 03:17

Disable keyboard keys function

27 Sep 2011, 00:11

Hello.

As I can see, when I press "Send Image", or "Contact Us" in picture view mode, then keyboard keys (Shift, space, enter, arrows) interact only with textfields in those modules, even if "keycontrols" for navigating the gallery are enabled in admin panel.

I wonder if there is function similar to "_root.setcopyroot()" which I can call in my modules, like: "_root.keycontrolsEnable()" / "_root.keycontrolsDisable()"

Thanks for reply :wink:
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

Re: Disable keyboard keys function

27 Sep 2011, 11:03

Hmm, I am not quite sure what you are asking for ... We added these keycontrols manually to the contact forms just to make them usable ... I am not quite sure how else you would have it work?
 
User avatar
Artur
Imagevue PowerPack
Topic Author
Posts: 510
Joined: 20 May 2011, 03:17

Re: Disable keyboard keys function

27 Sep 2011, 11:23

Yep, I was not enough precise :oops:

I speak about keycontrols functionality - when viewing gallery, some of the keyboard keys interact with gallery (next image, previous image, back...), but when click on "send image", then this functionality is disable. I can easy type in textfields and keys not interact with gallery.
So, my question is - how can I do the same in my background module where I have input text field? Is there any function in _root which I can call? Example:
Code
my_showTextfield_button.onPress=function(){
    show_my_input_textfield();
    _root.disableKeyboardListener();
}

my_hideTextfield_button.onPress=function(){
    hide_my_input_textfield();
    _root.enableKeyboardListener();
}

EDIT:

And one more thing.
In Admin panel -> Settings -> Controls -> Keycontrols, I can see note:
"Enable arrow controls to be used for navigating the gallery - next/previous/togglethumbnails/toggleplay"

It's mean that enabled should be only arrows, but gallery is sensitive also on keys: Space, Enter and backspace :roll:
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

Re: Disable keyboard keys function

28 Sep 2011, 00:33

Artur wrote:I speak about keycontrols functionality - when viewing gallery, some of the keyboard keys interact with gallery (next image, previous image, back...), but when click on "send image", then this functionality is disable. I can easy type in textfields and keys not interact with gallery.
So, my question is - how can I do the same in my background module where I have input text field? Is there any function in _root which I can call?
There is not actually any code to disable the keycontrols for the gallery once the send-email form is open. The only difference is that the input fields themselves most likely nullify the gallery-specific keycontrols, because arrow keys are hi-jacked natively by the textfields to navigate inside the textfield. This is not related to any code we are using unfortunately ...

The code for the gallery keycontrols is below. You may be able to delete the "controlkey" or delete the event, but then you would need to re-apply it to initiate it again.
Code
if(config2.config.imagevue.controls.keycontrols._value){
	controlkey = new Object();
	controlkey.onKeyDown = function() {
		if(!pagemode){
			if (Key.getCode() == "39" || Key.getCode() == "32" || Key.getCode() == "13") {
				nextfunc();
			} else if (Key.getCode() == "37" || Key.getCode() == "8") {
				previousfunc();
			} else if (Key.getCode() == "40") {
				togglethumbnailsfunc();
			} else if (Key.getCode() == "38" and !thumbsmode) {
				toggleplayfunc();
			} else if (Key.getCode() == "187" || Key.getCode() == "107") {
				setslideshowinterval(1);
			} else if (Key.getCode() == "189" || Key.getCode() == "109") {
				setslideshowinterval(-1);
			}
		}
	};
	Key.addListener(controlkey);
}
Artur wrote:And one more thing.
In Admin panel -> Settings -> Controls -> Keycontrols, I can see note:
"Enable arrow controls to be used for navigating the gallery - next/previous/togglethumbnails/toggleplay"

It's mean that enabled should be only arrows, but gallery is sensitive also on keys: Space, Enter and backspace :roll:
I beg to differ ... The controls for the input fields are simply keys that simulate how most modern html fields work, and should work. I don't see why they should be in settings as they are an integral part of an improved form interactivity. Besides, I am not sure what you mean by "space" ... The only effect this has, is a space in the textfield ... and same with backspace. Enter+Tab effects the form, like any modern html form ...
 
User avatar
Artur
Imagevue PowerPack
Topic Author
Posts: 510
Joined: 20 May 2011, 03:17

Re: Disable keyboard keys function

28 Sep 2011, 10:05

mjau-mjau wrote: I beg to differ ... The controls for the input fields are simply keys that simulate how most modern html fields work, and should work. I don't see why they should be in settings as they are an integral part of an improved form interactivity. Besides, I am not sure what you mean by "space" ... The only effect this has, is a space in the textfield ... and same with backspace. Enter+Tab effects the form, like any modern html form ...
I think we simply misunderstand each other. My english is not good enough, sorry for that :)

I've just about gallery navigation. gallery navigation is sensitive not only on arrows but also on "spacebar", "enter" - as next photo, and "backspace" - as previous photo.

I've thought that when I turn on keycontrols in admin panel, then I can navigate pictures/thumbnails using only arrows (as it's mentioned in "keycontrols" description). Then I'll not care about this at all, because arrows in textfields are used rarely...
But, the reason why I posted this topic was that turning on keycontrols, make "spacebar", "enter", and "backspace", also as keycontrols (the description don't says nothing about them, so I've thought there's some bug with).
So, typing in my input fields, causes changing pictures backward and forward all the time, becuase spacebar, enter and backspace are in use all the time when typing ...

But now, when I know the key listener object name the problem is gone. Now I'm able to switch it on and off from my module.
Thanks a lot for that :wink: