Jump to content
Flirc Forums

joystick inputs?


Snag
 Share

Recommended Posts

I have a generic MCE remote that has a pad input that act like a joystick which moves the curser around.  How can I program the pad to work?  Also, I'd like to program 2 keys to act like a left & right mouse buttons.

 

I'm realy liking Flirc, is there any plans to include a template to easily program a joystick?

 

post-18122-0-02119900-1422552915_thumb.j

Link to comment
Share on other sites

Hi,

 

Flirc works only as a keyboard and can't be used as a mouse - at least not directly. You can use an application which allows to control mouse cursor and buttons with a keyboard and configure both Flirc and that app to use the same keyboard key combinations.

 

Links to search results for controlling a mouse with a keyboard (native or with AutoHotKey or with EventGhost)

https://www.google.pl/search?q=control+mouse+with+keyboard

https://www.google.pl/search?q=control+mouse+with+keyboard+ahk

https://www.google.pl/search?q=control+mouse+with+keyboard+eventghost

  • Like 1
Link to comment
Share on other sites

That's disapointing... I bought the Flirc after becoming completly frustrated with EventGhost.  I will say Flirc works great for the keyboard stuff and is by far the easest to program by far.  But the lack of mouse/joystick movment support is a deal killer.  I'm not interested in complicated work arounds, learing a new programing language or more programs to hack a solution. I need something that just works and is family/wife freindly.

 

Are there any plans to include a template to program a joystick in the near future or do I need to return it?

Link to comment
Share on other sites

Sorry to disappoint you. As far as I'm aware there are no such plans, but only Jason would be able to tell for sure.

 

On the other hand there isn't really much choice besides Flirc if you don't want to use support software running constantly in the system. You could always use MCE remote and receiver but then you need to stick to specific remote (or use universal remote with MCE profile) and you can't really change anything on the receiving side (unless you run some support software anyway).

 

BTW I don't really understand what exactly is hacky in doing some stuff in EventGhost. I'm using it with my Flirc for some advanced controls and it doesn't make it any harder to use for anyone. I would rather say it makes it easier for my wife to use and she is definitely not a programmer.

Link to comment
Share on other sites

I might be way off base, but I would think that joystick/mouse type control movement support would be fairly easy to implement as it works fine with the IR receiver that came with the MCE remote natively.  I'm not a programmer in any sense of the word and I found EventGhost miserable hence my reason for trying Flirc after many frustrating hours.  Like I said, the Flirc is very easy to set up and intuitive with the templates provided.  It's just kinda strange to me that the joystick/mouse type control movements are missing.

As far as using Flirc to control EventGhost to control another program... well, that kinda defeats the entire Flirc concept IMO.  If I wanted to use EventGhost I'd just use EventGhost and forgo Flirc all together.  I'd venture a guess that most folks who buy a Flirc are in the same boat as me.  They want a fairly simple solution that doesn't involve other programs and hours of programming and aggravation.  Then again, maybe I'm way off base and have unrealistic expectations.

 

Link to comment
Share on other sites

I might be way off base, but I would think that joystick/mouse type control movement support would be fairly easy to implement as it works fine with the IR receiver that came with the MCE remote natively.  I'm not a programmer in any sense of the word and I found EventGhost miserable hence my reason for trying Flirc after many frustrating hours.  Like I said, the Flirc is very easy to set up and intuitive with the templates provided.  It's just kinda strange to me that the joystick/mouse type control movements are missing.

What's interesting, I, as a programmer myself, frequently hear from non-programmers that something should be easy to implement :).

 

OK, lets quickly compare Flirc with MCE receiver:

 

Flirc: presents itself to a computer as two devices: a keyboard and a special device which allows programming using Flirc software

MCE: presents itself to a computer as two devices: a keyboard and a mouse

 

Flirc: allows programming almost any key combination for almost any remote control button (there are some exceptions and hard to support remote protocols - that's why "almost")

MCE: works only with a predefined remote and sends only a predefined commands to the computer

 

They both are using some kind of microcontroller for their operation.

 

Flirc: uses a small Atmel ATmega microcontroller which does everything in software: bootloader (ability to safely upgrade firmware), IR recognizing, IR recording logic, HID keyboard protocol and USB protocol - unfortunately this microprocessor doesn't have unlimited amount of space and processing power

MCE: I don't know what it uses but it's probably some dedicated chip

 

Flirc: created by a single person who is trying as best as he can to bring new features and fix issues as fast as he can besides his daily job and family (you can read here why Flirc was created in the first place https://www.flirc.tv/fundraising/)

MCE: created by big companies with a lot of money (originally by Microsoft)

 

As you can see by comparing both devices it may no longer be that easy to implement mouse support (not impossible, but certainly not easy).

 

Flirc is and always was advertised as a device that works like a keyboard and it does that very well. It can be a whole solution for some users and just a part of a solution for others. If you only need a simple control of some applications using keyboard then you are good to go. If you want something more advanced, then you must use some support software.

 

 

As far as using Flirc to control EventGhost to control another program... well, that kinda defeats the entire Flirc concept IMO.  If I wanted to use EventGhost I'd just use EventGhost and forgo Flirc all together.  I'd venture a guess that most folks who buy a Flirc are in the same boat as me.  They want a fairly simple solution that doesn't involve other programs and hours of programming and aggravation.  Then again, maybe I'm way off base and have unrealistic expectations.

 

I don't think that using EG is defeating whole Flirc concept. You still get standard functionality, but you just supplement it with things it can't do by itself. For a mouse control you just need 6 extra buttons recorded to some key combinations that are later caught by the software and translated into mouse movement and clicks. Everything else can be still left to the Flirc.

 

BTW if you look at the first google link I've posted you can find info on how to control mouse with a keyboard in Windows without any additional software. It may work with Flirc.

  • Like 1
Link to comment
Share on other sites

Ok, so let's stop arguing what Flirc should and shouldn't do and find a solution native to Flirc.

So, it's possible in windows to use the "Ease of Access Center" functions to use the numeric keypad to emulate the curser/mouse movements.  The problem is the full keyboard template doesn't include the keypad.  A numeric keypad would be the optimal solution but baring that is appears the Command Line Interface (flirc_util.exe) may to be able to get the proper codes in.  Unfortunately the CLI isn't documented and there's only a few cryptic references in the forums.  I've found some key codes, ASCII codes and some USB HID codes that might be of use.  The question is which codes to use and what format to use with the CLI to get them in.  I found a reference to "flirc_util.exe record_api xxx xxx" though I'm not sure what the convention is and what the proper codes to use are.  Maybe you coukld spread some light on that?

The first challenge is to send the command "Left Alt+Left Shift+Num Lock" to turn on the keypad mouse functions.  I'd envision having a button to to the function on and off.  The question is - what is the CLI syntax to send multiple keys and what codes would be appropriate?

Once the keypad mouse is active then we need to get the codes in to control the curser movement.  The keypad can do 9 directions, but I think the MCE remote may just have left, right, up & down on the keypad.  Even if it's possible to do all 9, programming just the 4 basic would suffice as we only need rudimentary movements.  I don't think folks are going to seriously try and play games or anything; we just need to be able to move it to a given location.  The question is - what is the CLI codes would be appropriate for LEFT - RIGHT - UP - DOWN

Now we need to figure out the mouse button functions, left mouse click & Double-click & right mouse.  I don't think any of those are difficult, but again we need to figure out the key codes and the syntax for the CLI.
    
Your thoughts?

post-18122-0-66839900-1422726635_thumb.j  post-18122-0-77792600-1422726638_thumb.j

 

post-18122-0-30061300-1422726733_thumb.j

Link to comment
Share on other sites

You are on the right track. The record_api is the right way to go.

 

If you just run

flirc_util.exe record_api

in the command terminal window you'll get following info

Help for `record_api' command:
Send the raw HID value down to flirc to be linked with button recorded
usage:
  record_api 'arg1 arg2'   arg1 is key-modifier
                           arg2 is HID key
example:
  flirc record_api 136 4   '136' represents right cmd + left cmd
                           '4' represents 'a' in HID

Key modifiers are defined in the IEEE HID Spec as follows:
LEFT  CONTROL          1
LEFT  SHIFT            2
LEFT  ALT              4
LEFT  CMD|WIN          8
RIGHT CONTROL          16
RIGHT SHIFT            32
RIGHT ALT              64
RIGHT CMD|WIN          128

To record Control + Shift, logically or 1 & 2 to make 3

As you can see the first value is a combined modifier value. "Left Alt+Left Shift" is 2 + 4 (to be exact it's logical or, not arithmetic sum, but with values like above it's the same) = 6.

 

The second value is a HID key code given in decimal value. The table you've posted is OK, you just need to convert from HEX values in the HID column to decimal values (you can use Windows' calculator in programmer mode). For example numlock has HID code value 53(hex) which is 83(dec).

 

So to record enabling and disabling mouse movement you need to run

flirc_util.exe record api 6 83

For other keys you don't need modifier so you need to use value 0 for the first argument.

 

Now, as Flirc doesn't do chained key strokes like "/5" or "-5" you'll need to separately record button selector (/ and - for left and right mouse button) and then click and double click (5 and +). You don't need to select left or right button every time you want to click or double click. Windows uses last button you've selected on following clicks (left is default after turning mouse movements so you don't need to select it unless you switch to right button and want to go back  to left button).

 

Decimal HID values for some keys:
2 - 90

4 - 92

5 - 93

6 - 94

8 - 96

/ - 84

- - 86

+ - 87

Link to comment
Share on other sites

Had a little time to play with this:

 

Turn on Mouse Keys - flirc_util.exe record api 6 83        Works fine, toggles mouse keys on/off just as expected.

 

unfortunately Up, down,left & right don't work.  The CLI seemed to take them correctly but the reprogrammed buttons don't move the mouse. 

 

Here's the CLI lines I used. the Any Ideas?

Keypad 2 and Down Arrow - flirc_util.exe record api 0 90
Keypad 4 and Left Arrow - flirc_util.exe record api 0 92
Keypad 6 and Right Arrow - flirc_util.exe record api 0 94
Keypad 8 and Up Arrow - flirc_util.exe record api 0 96

 

I haven't tackled the left/right buttons yet, figured I'd take baby steps :)

Link to comment
Share on other sites

I've tested this before posting and it's worked for me without a problem. Make sure that the numlock is ON - when Mouse Keys function is turned on the numlock toggles between mouse movement (numlock ON) and cursor keys (numlock OFF).

 

If you want to control numlock status from the remote then you can record numlock key without modifiers:
flirc_util.exe record api 0 83

 

By using that key you should be able to switch between using cursor keys and mouse movement.

Link to comment
Share on other sites

  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...