Recent

Author Topic: IDE support for Game controllers etc. on Linux  (Read 167 times)

MarkMLl

  • Full Member
  • ***
  • Posts: 131
IDE support for Game controllers etc. on Linux
« on: October 10, 2019, 12:01:43 pm »
A few months ago I added a couple of pages to the wiki on using a game controller to drive the IDE, which is something I find particularly useful:

https://wiki.freepascal.org/Lazarus_IDE_with_Nostromo_Keypad_on_Linux
https://wiki.freepascal.org/Lazarus_IDE_with_Gamepad_on_Linux

The downside of this is that it needs a key combination for every function, and doing something like allocating a button for every bookmark in a file would both be arduous and would risk clashing with combinations normally reserved for the desktop environment.

Noting a forum discussion yesterday where I pointed somebody at using evtest to get keycodes, is there an "easy" way that an HID device could be plumbed directly into the Lazarus IDE, e.g. by having a plugin detect kernel-level events and inject them as IDE operation codes after the normal key translations?

As a related issue, it would be very useful for the "Set a free bookmark" to also remove an existing bookmark. Can this be done?

MarkMLl


« Last Edit: October 10, 2019, 12:05:46 pm by MarkMLl »
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

avra

  • Hero Member
  • *****
  • Posts: 1685
    • Additional info
Re: IDE support for Game controllers etc. on Linux
« Reply #1 on: October 10, 2019, 12:23:00 pm »
Wouldn't it be easier to simply use some software to map joystick to keyboard?

https://duckduckgo.com/?q=map+joystick+to+keyboard
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

MarkMLl

  • Full Member
  • ***
  • Posts: 131
Re: IDE support for Game controllers etc. on Linux
« Reply #2 on: October 10, 2019, 12:37:52 pm »
Read the links, that's exactly what I've done. However if you go that way you have to reserve a key-combination for every operation, and something like the Nostromo pad (again, described in one of my links) has more events than are available. In addition I've already had to tell KDE to ignore one particular combination so as not to do something inappropriate when it sees one of the IDE's shortcuts.
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

avra

  • Hero Member
  • *****
  • Posts: 1685
    • Additional info
Re: IDE support for Game controllers etc. on Linux
« Reply #3 on: October 10, 2019, 04:05:14 pm »
Then you need to make an IDE plugin which would listen to joystick events and directly call particular IDE method or menu item, or indirectly generate keyboard press that you map in your code or external file.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

MarkMLl

  • Full Member
  • ***
  • Posts: 131
Re: IDE support for Game controllers etc. on Linux
« Reply #4 on: October 10, 2019, 04:07:39 pm »
Exactly. So as I put in my original question, is there an "easy" way to do that or does anybody have any example code etc.?
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.