Can I assign a macro to a switch outside the keyboard?

Talk about anything at all....
Post Reply
imadumby
Posts: 42
Joined: Sat Sep 26, 2020 6:42 pm

Can I assign a macro to a switch outside the keyboard?

Post by imadumby »

I asked the current JoyToKey question when another idea came to me that I thought deserved its own thread. I got some responses that seemed like were way beyond my capabilities, so I thought I'd try asking this instead.

Suppose a coin was dropped into a slot and it hit a switch outside of the keyboard. That switch then triggered a macro that was assigned to the switch, which then made an entry onto a spreadsheet.

My question: how could that switch be assigned to the macro in open office?

This page tells how it can be assigned to a key on the keyboard which seems like it's pretty easy to do:
https://wiki.openoffice.org/wiki/Docume ... o_a_key%3f
How can I assign a macro to a key?

But is it eady, hard or even doable with a switch OUTSIDE the keyboard? How could I do it?
Open Office 4.1.7, Windows 10
User avatar
Zizi64
Volunteer
Posts: 11345
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Can I assign a macro to a switch outside the keyboard?

Post by Zizi64 »

Just a workaround tip (related to your another topic: viewtopic.php?f=49&t=103121)

Use the Function keys on the keyboard.
You can
- to assign (reassign) macros, user defined functions to them.
- to stick the desired paper letters (p, n, d) onto them.

Do not use (and you can not use) the Function keys what are assigned to very important or System functions (they are greyed in the Customize feature).

The
F7: Spelling
F8: Status Extended selection
F9: Recalculate
seems recustomizeable in my LibreOffice. You can reassign the original functions of the F-keys to an another free Shift-Key, Alt-Key or Ctrl-Key combination - if you needed them anyway. And many functions are available from the menu too.


Otherwise you MUST write your own application/software what will able to handle the outside buttons/switches AND what can handle/control the OpenOffice/LibreOffice and the Spreadsheet documents.
Last edited by Zizi64 on Wed Sep 30, 2020 10:15 pm, edited 1 time in total.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Mountaineer
Posts: 306
Joined: Sun Sep 06, 2020 8:27 am

Re: Can I assign a macro to a switch outside the keyboard?

Post by Mountaineer »

imadumby wrote: But is it eady, hard or even doable with a switch OUTSIDE the keyboard? How could I do it?
The question ist not, If your Switch ist outside the Keyboard, but how ist ist conected.

If your coin machine hast no Connection, ist IS not possible to assign anything.

Your Switch musst tell the Computer it IS an alternate Keyboard or Mouse with more Buttons, Then you can use it.

My Suggestion would be to use an external numeric keypad and drop your coins on that Keys.

There is a Project named AutoHotKeys, where keyboard Input ist modified. Maybe there is a possibility for your project. But they May run in the Same problem as your Joytokey.

regards, Jörn
OpenOffice 3.1 on Windows Vista
imadumby
Posts: 42
Joined: Sat Sep 26, 2020 6:42 pm

Re: Can I assign a macro to a switch outside the keyboard?

Post by imadumby »

Mountaineer wrote:
imadumby wrote: The question ist not, If your Switch ist outside the Keyboard, but how ist ist conected.
It's connected by one of these:
https://www.amazon.com/Hikig-Joystick-R ... 204&sr=8-1

Note that on the cord one end is a regular USB connection into the computer and the other end has a big fat connection
(I think its a different "USB" connection but I'm not sure) that goes into the controller.

This somehow goes straight into the the Joytokey but if you don't have the joy to key I don't know what it goes into.

Looks like checking out auto hot keys is the next thing to do. Thanks!
Open Office 4.1.7, Windows 10
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Can I assign a macro to a switch outside the keyboard?

Post by RoryOF »

Just for information: a "big fat connector" might be an RS232 serial connector. It will be shaped like this

Code: Select all


______________
 \  o o o o o /
  \ o o o o /
   ---------
There are nine connectors - I think sockets - so long since I have seen one I cannot remember.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
imadumby
Posts: 42
Joined: Sat Sep 26, 2020 6:42 pm

Re: Can I assign a macro to a switch outside the keyboard?

Post by imadumby »

Sorry for the bad description. Its a USB type 2 cable, the kind used on printers.
Open Office 4.1.7, Windows 10
User avatar
Zizi64
Volunteer
Posts: 11345
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Can I assign a macro to a switch outside the keyboard?

Post by Zizi64 »

It's connected by one of these:
https://www.amazon.com/Hikig-Joystick-R ... 204&sr=8-1
Yes, we know now, how you will connect the device physically. The question is now: how the device will be connected programatically to the Spreadsheet file?

Has the device some driver? Wich type of the drivers that device has?

- it will be recognized as a Virtual Serial Port? - That is independent from the keyboard handlers and drivers of the operating system. Therefore you need write your own software to handle the signals of the device, and you must make a software connection between the device and the Spreadsheet file. But this task not related to this Forum.

- it will/can emulate some keyboard hit? - Then the main question is: can you set the assigned and emulated keys in some driver? You must choose some Function keys or Key-combos (for example: Alt-Ctrl-J), because those are assignable to some macros in the Calc. The pure letters (and the numbers) are not assignable to the macros.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
imadumby
Posts: 42
Joined: Sat Sep 26, 2020 6:42 pm

Re: Can I assign a macro to a switch outside the keyboard?

Post by imadumby »

Zizi64 wrote:

Yes, we know now, etc.
It has no driver.

I have found a driver that I think would be good to use accept it doesnt allow enough buttons to be useful for what I'm doing. As far as I know this device is used to control joysticks for video games, and I discovered that the switch outputs could be sent through JoyToKey to get the result I want (at least for a little while until it starts messing up). JoyToKey is software, but I guess it's not a "driver", not really sure what the difference is.

From what your saying, barring some stroke of luck, looks like I'll need some software to do this. Got any tips for
a person who knows nothing about writing software on ideas for how to get this done? To make software to do this, do you think it would be some very enormously complicated job to do?

I know this is way below this forums level, so if I don't get a response, thats pretty much what I expect. Whatever the case, thanks for taking time to explain this to me.
Open Office 4.1.7, Windows 10
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Can I assign a macro to a switch outside the keyboard?

Post by RoryOF »

It is years since I used Windows, but it is possible that the driver uses a plain text configuration file, in which the various buttons are defined; some of these may be disabled by being commented out. If there is such a file, it is worth investigating it and playing with any disabled options; joystick/mouse manufacturers sometimes manufacture devices of different complexities (and expense) and often use the same driver for all, selecting the exact device by such a configuration file.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Post Reply