Problems with key bindings

Two problems:

Problem #1) Is it possible to bind something to Alt-UP? I have tried M-UP and ALT-UP, both prevent mocp from running, with this error message:

FATAL_ERROR: Parse error in the keymap file line 83: bad key sequence

Problem #2) I configured a few "fast dirs":

go_to_fast_dir1 = M-1
go_to_fast_dir2 = M-2
go_to_fast_dir3 = M-3

FATAL_ERROR: Key M-1 is defined for volume_10 and go_to_fast_dir1

Yes indeed, but the line that binds M-1 to volume_10 is commented out! Even deleting the line altogether doesn't solve the problem.

So I assign something else to it:

volume_10 = !
volume_20 = @
volume_30 = #

Now I don't get that error message anymore, but M-1, M-2 and M-3 do nothing! They should be triggering the fast dirs.

I end up binding just plain numbers to the fast dirs...

go_to_fast_dir1 = 1
go_to_fast_dir2 = 2
go_to_fast_dir3 = 3

That works, but it's not what I wanted.

Looks like a bug to me.

Another keybinding bug:

if you would like to bind any external command to keys F1-F4 - it fails.
I.e. if you have in config (and have no changes in keymap, I mean "F1 = ExecCommand1"):

ExecCommand1 = "mv %f /whatever/you/like"

it brings with F1 up "Bad command" error while playing track rewinds for several seconds.
But if you have in config such bindings for keys F5-F10 - it works like a charm.

It seems to me that keys F1-F4 are hard-binded for something else.
Please, fix.

I cannot reproduce this problem, and "ais77" has not replied to an e-mail seeking diagnostic information. Therefore I'm assuming it's either a usage problem or has already been fixed in MOC 2.5-beta1.

MOC does not treat F1-F4 specially.

The thing is that the keymap.example seems to be just a repetition of default settings hardcoded in the program.
Before reusing the key assigned to other function, you first need to release that key,
i.e. assign some other key to the function, or just clear the key binding of that function.

In my case I wanted to move the playlist cursor like in vim, i.e. with j/k keys (I use vim for all editing, pentadactyl for web browsing and have bash configured in vi mode, so moc was the last program which forced my right hand to travel to the arrows area of the keyboard), and following 4 lines constitute my keymap file (it is the entire file, for other functions I use the defaults coming from within the mocp program itself):

plist_move_down =
equalizer_next =
menu_down = j
menu_up = k

In my opinion it's not a bug, rather a too short error message.

Sorry, I seem to have missed this when it was originally posted.

Is it possible to bind something to Alt-UP?

Combining a special key (like UP) with a modifier (like ALT) is not currently possible. Only single character keys are allowed.

In the future, you will be able to ask MOC what the keycode for any given keypress is on your system then use that to define the key's action.

M-1, M-2 and M-3 do nothing!

There are actually three issues here:

  • As far as back as I can test (MOC 2.5-alpha4), MOC does not recognise the meta-keys at all. This is obviously a bug, but it does suggest that no one is using the predefined M-? keys. I have a patch ready for this, but it triggers a second bug.
  • MOC does not distinguish between a meta-key sequence and an escape-key sequence. This problem is not unique to MOC and I've known about it for some time, but I also have a patch ready to fix it.
  • The third issue is more of a "clunky behaviour" rather than a bug. The problem is that when the user binds a key to an action in the keymap, it would be nice if MOC automatically unbound it from any default binding. I also have a patch for this.

I will commit the patches for these when I've finished testing them.

After considerable difficulties testing these patches in GUI environments they have now passed and been committed as r2537:2539.