[Solved] Programming function keys

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Gandalf the White

[Solved] Programming function keys

Post by Gandalf the White »

How would I program a Function Key in the Cinnamon environment?

Is there a URL tutorial for programming Cinnamon Function keys?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29610
Joined: Wed Jul 06, 2011 3:58 am

Re: Programming function keys

Post by xenopeek »

Do you perhaps mean to configure a function key as a keyboard shortcut? Open Keyboard from the menu, go to the Keyboard Shortcuts tab and have at it. Though note that some applications may use the function keys, as does for example Cinnamon itself for window management controls (Alt + various function keys).
Image
Gandalf the White

Re: Programming function keys

Post by Gandalf the White »

xenopeek wrote:Do you perhaps mean to configure a function key as a keyboard shortcut? Open Keyboard from the menu, go to the Keyboard Shortcuts tab and have at it. Though note that some applications may use the function keys, as does for example Cinnamon itself for window management controls (Alt + various function keys).
I must be denser than I look. Could you out together an example tutorial for me.
What goes in where?

Thanks.
User avatar
xenopeek
Level 25
Level 25
Posts: 29610
Joined: Wed Jul 06, 2011 3:58 am

Re: Programming function keys

Post by xenopeek »

Right, so I was typing how to do this and moving along with an example. But it doesn't work! Any keyboard binding I tried doesn't actually run the command I give. I think this functionality is broken, or perhaps somebody else can pipe in on this what I'm doing wrong :roll:

-----

Open your Menu, open Cinnamon Settings, open Keyboard from there. Go to the Keyboard Shortcuts tab.

Click the "Add custom shortcut" button near the bottom of the window. For Name, enter something that will help you remember what this is. As an example, I'll enter "Kill Program". For Command, enter the command that should be run. You can use the button beside it on the right to browse to a program to run, or you can manually enter the command to run. As an example, I'll enter "xkill". Click Add to complete.

You'll find your new shortcut in the Custom Shortcuts category, which you can select in the list on the left side of the window. It will show the list of keyboard shortcuts in this category in the top list on the right side of the window. You can select your new shortcut there. It will then show the keyboard bindings for your new shortcut in the list beneath that. It will display "unassigned", because you didn't set a keyboard binding yet.

Click on "unassigned" to highlight it, then click again and the text should change to "New accelerator...". You can now press the key combination you want your new shortcut. For my example I will use Ctrl+Alt+X, so I press and hold the Ctrl and Alt keys, and add the 'x' key. The text that first read "unassigned" now has changed to "Ctrl-Alt-x".

-----

I tried Ctrl+X, Alt+X, and other combinations. None worked. I used the full path to xkill, /usr/bin/xkill, but that also didn't help. I restarted Cinnamon, logged out and in again, and even rebooted as some issue on GitHub suggested, but none of it worked... So though I thought I knew how to add a keyboard shortcut, it appears either I don't or this functionality is broken in Cinnamon :(
Image
Gandalf the White

Re: Programming function keys

Post by Gandalf the White »

Thanks, xenopeek. Seem I'm not that batty after all.
Gandalf the White

Re: Programming function keys

Post by Gandalf the White »

I may have found a program (keytouch) for defining function keys, but my keyboard is to new and they don't have a structure for it yet.
For those with older keyboards... http://keytouch.sourceforge.net/download.php

I hope it work for you.
Locked

Return to “Cinnamon”