Page 1 of 1

Keyboard 'Ctrl' provokes scrolling... Possible? How?

Posted: Fri Jan 18, 2019 4:44 am
by markfilipak
Hello. It looks like Phil has done a comprehensive job -- Thank you, Phil! I'm new to XMBC. I'm glad to be here. This is my first topic.

Is there a way to set up XMBC so that, while the user is depressing the keyboard 'Ctrl' key, in addition to being reported as cursor movement (the usual response), 'mickeys' are also reported as scrolls? In other words, scrolling is toggeled on and 'mickeys' are piped to the x-y scrolling inputs while the 'Ctrl' key is depressed (and only then).

I must confess that I don't know how Windows handles 'mickeys'. I imagine 2 possiblities:
1, If cursor position is document-centric, then the effect would be that the cursor appears to stand still while the mouse-moves scroll the document, or
2, If cursor position is window-centric, then in order to achieve the effect, 'mickeys' would need to be blocked instead of being passed to the API.
I believe that the earliest versions of Windows utilized window-centric mouse reports (i.e., #2), but that was a long, long time ago and I may be wrong.

I tried to create this effect and wound up having to assign it to a mouse button (rather than to the naked 'Ctrl' key). So, I assigned 'Ctrl' as a left mouse button modifier and tested the result. It did not go well. I managed to lock up the GUI in scroll mode (but fear not; I did find a way to recover by launching Task Manager via keyboard and then using it to kill the process, so that's not the reason for this topic).

Is it possible to achieve the desired effect? How?

Your thoughts are very welcome... Let the Rumpus begin!
Mark.

Re: Keyboard 'Ctrl' provokes scrolling... Possible? How?

Posted: Fri Jan 18, 2019 9:14 am
by phil
Hi Mark,

Its not currently possible. But I think there is an item on the todo list to enable this functionality which will probably go into the next version.
It will do this by adding an action to be enabled when switching to a layer (without having to press a button). Then you should be able to set that action to "Change movement to scroll". I haven't started to look at this yet so it may be more difficult than I imagine. Keep an eye on the 2.19 beta thread (when it gets created) to monitor progress/test/feedback :)

Thanks,
Phil

Re: Keyboard 'Ctrl' provokes scrolling... Possible? How?

Posted: Fri Jan 18, 2019 9:18 am
by markfilipak
Thanks, Phil.

I'm having way too much fun exploring XMBC.

PS: Inability to block the 'Ctrl' key's transmittal to the application (TextPad in this case) is screwing the pooch.

Re: Keyboard 'Ctrl' provokes scrolling... Possible? How?

Posted: Fri Jan 18, 2019 9:27 am
by phil
Hi, yes the inability to block the keys is a known problem with layer modifier keys...
Unfortunately its simply not possible to block keys without breaking sooo much of Windows functionality.
I cant block the key on the assumption hat you *may* want to use it to switch layers, because if you don't, say you pressed CTRL+C, and the CTRL were blocked, then you wont COPY, you will simply type C... On top of that, If XMBC blocked the CTRL key and waited, and then realized it should not have blocked CTRL, it could inject a CTRL, but not before the second key (C) was sent, resulting in C+CTRL which again wouldn't work. And on top of that injecting keys does not always work - some (mostly games) blok injected input, leaving the key not working at all :(.

Put simply, I believe it too dangerous to block keys and thus have left it at that.
The only workaround is to use global hotkeys to switch layers and add a timer on the layer to switch it back.. That way no key needs to be held down while the layer is switched and the button pressed.

Thanks,
Phil

Re: Keyboard 'Ctrl' provokes scrolling... Possible? How?

Posted: Fri Jan 18, 2019 9:42 am
by markfilipak
phil wrote: Fri Jan 18, 2019 9:27 am ... I cant block the key on the assumption hat you *may* want to use it to switch layers, because if you don't, say you pressed CTRL+C, and the CTRL were blocked, then you wont COPY, you will simply type C...
I hesitate to belabor (Amer. for "belabour") the point but consider:

'Ctrl' press: Block key & activate modifier ...
'Ctrl' release: Unblock key & deactivate modifier ...

OR

'Ctrl' press: Block key & activate modifier ...
'C' press: Send 'Ctrl+C' to application & unblock key & deactivate modifier ...
'Ctrl' release or 'C' release: Do nothing ...

Re: Keyboard 'Ctrl' provokes scrolling... Possible? How?

Posted: Fri Jan 18, 2019 12:24 pm
by phil
Yes it might work in some cases, but as I said, for anything that blocks simulated input, that wont work because the injected CTRL will not be received.
And that's quite a big problem - maybe it wont affect you but anyone that uses XMBC in apps/games that don't like injected keys will be screwed!