Re: [crossfire] [PATCH 1/2] Keybindings: multiple changes

2013-11-14 Thread Rick Tanner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/14/13 6:03 PM, Arvid Brodin wrote:
> 
> Of course, we would have to agree about the default set of
> direction keys... ;)

It's been my observation that the first thing a new player does when
they want to move their character - is to use the arrow keys.

So, I think the arrow keys need to remain available for movement.





-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iD8DBQFShWyhhHyvgBp+vH4RAu/xAKDdUAhI4hLe89RNAIk4o/zjCpM3HgCgsDzp
DvtdJtUuzCXaiBn3k+jMm94=
=C+JF
-END PGP SIGNATURE-
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire


Re: [crossfire] [PATCH 1/2] Keybindings: multiple changes

2013-11-14 Thread Arvid Brodin
On 2013-11-07 01:11, Kevin Zheng wrote:
> On 11/03/2013 11:15, Arvid Brodin wrote:
>> Anyway, this needs to be expressed with two keybindings in my code: one with 
>> no
>> modifiers (called "None" in the keybindings dialog), and one with the "Run" 
>> modifier. My code ignores the 'N' here since it means "no flags" and only 
>> looks 
>> at the 'R' - which of course breaks things. I will figure out a solution.
> 
> I'll try to break them down into two bindings for each command. But this
> seems cumbersome and bloated, and deserves to be fixed.

I've been thinking about this a bit. 

Hitherto, we've presented all keys equally to the user (direction keys look no 
different than other keys in the interface). But we've treated them differently
internally, using the run and fire "hacks" - so even though they appear no 
different
than other keys to the user, they actually work differently in combination with 
the
modifier keys. This has also caused the "Run" and "Fire" modifiers to be mixed 
in
with the Ctrl and Shift modifiers for other keys. Confusing is the word, I 
think. 

My patches aim to treat all keys in the same way internally - no "hacks". This 
also
means the user does not get the benefits of the "special internal tratment" 
that was
given before. Cumbersome seems like a fitting description.

Perhaps what we should do is the exact opposite of what's been done before: 
give the 
direction keys special treatment in the _interface_, but not in the code.

That could mean adding a new part to the Keybindings dialog, where you bind the 
keys 
for "North", "South", etc, and also select the modifier keys to use for Run and 
Fire.

Internally, the three needed bindings per key could then be created 
automatically.

Of course, we would have to agree about the default set of direction keys... ;)


-- 
Arvid
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire


Re: [crossfire] [PATCH 1/2] Keybindings: multiple changes

2013-11-06 Thread Kevin Zheng
On 11/03/2013 11:15, Arvid Brodin wrote:
> I think this is a problem with my code. 
> The default Nethack-style bindings look like this (from common/def-keys):
> 
> Logically that means they should work if no modifier keys are pressed, or with
> Run pressed. (Are you saying they work with Fire pressed as well?)

I've cleared out my old key bindings and have the client running from
defaults. The NetHack style keys don't work in "normal" mode, but do
when CTRL is pressed.

> Anyway, this needs to be expressed with two keybindings in my code: one with 
> no
> modifiers (called "None" in the keybindings dialog), and one with the "Run" 
> modifier. My code ignores the 'N' here since it means "no flags" and only 
> looks 
> at the 'R' - which of course breaks things. I will figure out a solution.

I'll try to break them down into two bindings for each command. But this
seems cumbersome and bloated, and deserves to be fixed.

Thanks,
Kevin Zheng
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire


Re: [crossfire] [PATCH 1/2] Keybindings: multiple changes

2013-11-06 Thread Kevin Zheng
On 11/03/2013 13:56, Mark Wedel wrote:
> The KP_ seem to depend on if numlock is on or off, so in theory
> can go, but at same time, I suspect would apply to non sun keyboards if
> numlock is off.  That said, hitting numlock is not hard, although
> perhaps a warning in the client could be added (Your numlock key is off
> - movement via the keypad will not work until you turn it on) type of
> thing.  I believe there is some way to get that status with gtk.

In my opinion, the client should only accept the arrow keys when the
number lock is off. That said, I don't see a reason to change this now
since it really isn't broken.

>  Not specific to that, but I suspect people playing on laptops/notebooks
> lack the numeric keypad, and just using the 4 direction keys is limiting
> (there are probably circumstances where you really need to move or fire
> diagonally)

I'm a regular user of the NetHack-style layout. It was working before
the new patches were introduced; somehow it seems to be in conflict with
the arrow keys. I'll be looking at how to fix it.

>  I suspect some of that is command history is a more recent feature and
> keybinding was never added for it (there are probably lots of commands
> which could use keybindings but are lacking them)

But new users will probably find arrow keys more intuitive. There should
be a way to spoon-feed new users key commands without annoying
experienced players.

Thanks,
Kevin Zheng
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire


Re: [crossfire] [PATCH 1/2] Keybindings: multiple changes

2013-11-03 Thread Mark Wedel

On 11/ 3/13 06:50 AM, Arvid Brodin wrote:



- How often do we get new players who use Sun Type 4 Keyboards? Perhaps these
   could go? (17 bindings.)


 Some of those still can apply for later sun keyboards (using a type 7 here). 
Since later keyboards are USB, they work fine on PCs also.


 I suspect the F ones can certainly go.

 The KP_ seem to depend on if numlock is on or off, so in theory can go, 
but at same time, I suspect would apply to non sun keyboards if numlock is off. 
 That said, hitting numlock is not hard, although perhaps a warning in the 
client could be added (Your numlock key is off - movement via the keypad will 
not work until you turn it on) type of thing.  I believe there is some way to 
get that status with gtk.




These I don't really know about:

- I've never seen the "Nethack-Style" key layout before. Also, they don't seem
   to work in conjunction with the Fire modifier (only N and R). Does the fact
   that that bug has never been fixed mean they aren't used at all, perhaps? Or
   do people just fix that when they start to play?


 Not specific to that, but I suspect people playing on laptops/notebooks lack 
the numeric keypad, and just using the 4 direction keys is limiting (there are 
probably circumstances where you really need to move or fire diagonally)




- Arrow keys... I *really* like the feature of command history and the prevkey/
   nextkey that is available. But these are not bound by default, so perhaps 
they
   aren't used as much as they could be. On the other hand, using the arrow keys
   for this (and not for north/south etc) requires an immidiate help text 
whenever
   a new character is started, to explain how to move.


 I suspect some of that is command history is a more recent feature and 
keybinding was never added for it (there are probably lots of commands which 
could use keybindings but are lacking them)


 Certainly help text could be updated.  I wonder if they could be bound to page 
up/page down by default (for keyboards that have that - see notebook issue 
above) - this way, they will still apply in keybindings for all users, so people 
could rebind them to other keys as they see fit.


___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire


Re: [crossfire] [PATCH 1/2] Keybindings: multiple changes

2013-11-03 Thread Arvid Brodin
On 2013-11-03 18:15, Arvid Brodin wrote:
> On 2013-11-03 16:50, Kevin Zheng wrote:
>> On 11/03/2013 08:50, Arvid Brodin wrote:
> 
> []
> 
>>> - 3 bindings of 'a' to "apply" (to handle different shift state and 
>>> modifier 
>>>   states). Replace with a single binding of 'a' with "Any" flag.
>>
>> In hindsight, there are some issues with setting the directional keys
>> with the "Any" flag. I usually bind ALT-B to 'cast burning hands', but
>> it conflicts with the 'Any' definition of a NetHack-style direction key.
>> Perhaps the 'Normal' checkbox should come back?
> 
> It does conflict. Before, you were allowed to enter conflicting keybindings,
> and now, you are not. The order the keybinds were made mattered before. Look
> at parse_key() in the old code. They find several matches: first_match, then
> tries to find a perfect match (keyentry), then proceeds to completely ignore
> the keyentry match...
> 

I took another look at this code and the keyentry isn't ignoread at all. The
code actually searches through the bindings to find a "perfect" match - if 
no such match is found, it selects the first match found that matches any of
the key modifier flags set.

-- 
Arvid
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire


Re: [crossfire] [PATCH 1/2] Keybindings: multiple changes

2013-11-03 Thread Arvid Brodin
On 2013-11-03 16:50, Kevin Zheng wrote:
> On 11/03/2013 08:50, Arvid Brodin wrote:

[]

>> - 3 bindings of 'a' to "apply" (to handle different shift state and modifier 
>>   states). Replace with a single binding of 'a' with "Any" flag.
> 
> In hindsight, there are some issues with setting the directional keys
> with the "Any" flag. I usually bind ALT-B to 'cast burning hands', but
> it conflicts with the 'Any' definition of a NetHack-style direction key.
> Perhaps the 'Normal' checkbox should come back?

It does conflict. Before, you were allowed to enter conflicting keybindings,
and now, you are not. The order the keybinds were made mattered before. Look
at parse_key() in the old code. They find several matches: first_match, then
tries to find a perfect match (keyentry), then proceeds to completely ignore
the keyentry match...

You can solve this easily enough. You should create separate bindings for all
of the direction keys with no modifers, with Run modifiers, and with Fire 
modifiers. Then you can also bind Alt + 'b' to cast burning hands.

This might seem a bit complicated, but it has two IMO large pros:

* We can skip special handling of the Run and Fire modifiers in the future. 
  Instead of giving Shift and Control special meanings if used in conjunction 
  with a direction key, the user simply creates bindings for 'east', 'run east',
  'fire east' etc. These can be set up so that they work exactly like today.

* It is transparent to the end user - he/she can see exactly what happens.
  No hidden special treatment of the Shift and Control keys.


I really need to take a good look at the def-keys file though...


>> - I've never seen the "Nethack-Style" key layout before. Also, they don't 
>> seem
>>   to work in conjunction with the Fire modifier (only N and R). Does the fact
>>   that that bug has never been fixed mean they aren't used at all, perhaps? 
>> Or
>>   do people just fix that when they start to play?
> 
> I've always used NetHack style keys, and they've been working fine all
> the time. After the update some interesting things are happening, which
> I'm working on investigating.

I think this is a problem with my code. 
The default Nethack-style bindings look like this (from common/def-keys):

b 1 NR southwest
h 1 NR west
j 1 NR south
k 1 NR north
l 1 NR east
n 1 NR southeast
u 1 NR northeast
y 1 NR northwest

Logically that means they should work if no modifier keys are pressed, or with
Run pressed. (Are you saying they work with Fire pressed as well?)

Anyway, this needs to be expressed with two keybindings in my code: one with no
modifiers (called "None" in the keybindings dialog), and one with the "Run" 
modifier. My code ignores the 'N' here since it means "no flags" and only looks 
at the 'R' - which of course breaks things. I will figure out a solution.


>> - 2 of 'e' to examine (shift state). Replace with single binding of 'e'.
> 
> There should just be one examine command, "examine." I think it should
> be bound to normal and CTRL.

It looks like this today:

e 1 RF examine
E 1 RF examine

I.e. it is bound to Run and Fire (and not Normal). And the double bind is 
used since 'e' and 'E' have different key codes. My code converts all
key codes to lowercase, since shift state is treated separately anyway.


>> - Arrow keys... I *really* like the feature of command history and the 
>> prevkey/
>>   nextkey that is available. But these are not bound by default, so perhaps 
>> they
>>   aren't used as much as they could be. On the other hand, using the arrow 
>> keys
>>   for this (and not for north/south etc) requires an immidiate help text 
>> whenever
>>   a new character is started, to explain how to move.
> 
> Thing with Crossfire is that we don't have a "pop-up-on-your-screen"
> tutorial at the beginning. And if players start by using the arrow keys
> (based on intuition), they probably won't discover the other ways to
> move, either.

You don't think a text in the message pane would be enough? Hmm, maybe not...


-- 
Arvid
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire


Re: [crossfire] [PATCH 1/2] Keybindings: multiple changes

2013-11-03 Thread Kevin Zheng
On 11/03/2013 08:50, Arvid Brodin wrote:
> I see what you mean - suddenly there's a lot of "noise" in the keybindings
> dialog. What I did was to remove all bindings that I don't use, and it feels 
> OK now. Perhaps that'll work for you as well? If you try it and still hate
> it, tell me and I'll see what I can do. :)

It's not too bad. Since most of my personal key bindings are applied
with the ALT key, I can just sort the list by modifier.

> I will also submit a cleaned-up version of the common/def-keys file. There 
> are some obvious clean-ups and some "maybe": 
> 
> - 3 bindings of 'a' to "apply" (to handle different shift state and modifier 
>   states). Replace with a single binding of 'a' with "Any" flag.

In hindsight, there are some issues with setting the directional keys
with the "Any" flag. I usually bind ALT-B to 'cast burning hands', but
it conflicts with the 'Any' definition of a NetHack-style direction key.
Perhaps the 'Normal' checkbox should come back?

> - 2 of 'e' to examine (shift state). Replace with single binding of 'e'.

There should just be one examine command, "examine." I think it should
be bound to normal and CTRL.

> - What's the difference between the "take" and the "pickup" commands? (',', 
>   '@')

The 'pickup' binding should probably go. In NetHack, '@' toggles
auto-pickup, but Crossfire's 'pickup' command requires an argument.
Perhaps it was left over from a long time ago.

> - How often do we get new players who use Sun Type 4 Keyboards? Perhaps these
>   could go? (17 bindings.)

Admittedly, not that often. Binaries aren't even being built for modern
Sun machines (with normal keyboards).

> - Is there a difference between "rotateshoottype -" and "rotateshoottype -1"?
>   Also needs modifier flags cleanup (A/N/NF).

Not exactly sure, they *seem* to do the same :p

> These I don't really know about:
> 
> - I've never seen the "Nethack-Style" key layout before. Also, they don't seem
>   to work in conjunction with the Fire modifier (only N and R). Does the fact
>   that that bug has never been fixed mean they aren't used at all, perhaps? Or
>   do people just fix that when they start to play?

I've always used NetHack style keys, and they've been working fine all
the time. After the update some interesting things are happening, which
I'm working on investigating.

> - Arrow keys... I *really* like the feature of command history and the 
> prevkey/
>   nextkey that is available. But these are not bound by default, so perhaps 
> they
>   aren't used as much as they could be. On the other hand, using the arrow 
> keys
>   for this (and not for north/south etc) requires an immidiate help text 
> whenever
>   a new character is started, to explain how to move.

Thing with Crossfire is that we don't have a "pop-up-on-your-screen"
tutorial at the beginning. And if players start by using the arrow keys
(based on intuition), they probably won't discover the other ways to
move, either.

Thanks,
Kevin Zheng
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire


Re: [crossfire] [PATCH 1/2] Keybindings: multiple changes

2013-11-03 Thread Arvid Brodin
On 2013-11-03 04:41, Kevin Zheng wrote:
> Committed in r19090.
> 
> To the best of my knowledge, Crossfire doesn't have a formal patch
> review process. By the time everyone reviews it, bit rot will have
> already set in. Best to commit it now and fix issues later if needed.

Ok.


> On 11/02/2013 18:24, Arvid Brodin wrote:
>> * Show all keybindings (incl default ones) in both 'unbind' and the 
>> keybindings
>>   dialog. (Should reduce confusion for new users.)
> 
> I almost want to say that I miss the old behavior. If feasible, I'd
> really like to see a "show non-default bindings only" checkbox.

I see what you mean - suddenly there's a lot of "noise" in the keybindings
dialog. What I did was to remove all bindings that I don't use, and it feels 
OK now. Perhaps that'll work for you as well? If you try it and still hate
it, tell me and I'll see what I can do. :)

I will also submit a cleaned-up version of the common/def-keys file. There 
are some obvious clean-ups and some "maybe": 

- 3 bindings of 'a' to "apply" (to handle different shift state and modifier 
  states). Replace with a single binding of 'a' with "Any" flag.

- 2 of 'e' to examine (shift state). Replace with single binding of 'e'.

- What's the difference between the "take" and the "pickup" commands? (',', 
  '@')

- How often do we get new players who use Sun Type 4 Keyboards? Perhaps these
  could go? (17 bindings.)

- Is there a difference between "rotateshoottype -" and "rotateshoottype -1"?
  Also needs modifier flags cleanup (A/N/NF).


These I don't really know about:

- I've never seen the "Nethack-Style" key layout before. Also, they don't seem
  to work in conjunction with the Fire modifier (only N and R). Does the fact
  that that bug has never been fixed mean they aren't used at all, perhaps? Or
  do people just fix that when they start to play?

- Arrow keys... I *really* like the feature of command history and the prevkey/
  nextkey that is available. But these are not bound by default, so perhaps they
  aren't used as much as they could be. On the other hand, using the arrow keys
  for this (and not for north/south etc) requires an immidiate help text 
whenever
  a new character is started, to explain how to move.



-- 
Arvid
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire


Re: [crossfire] [PATCH 1/2] Keybindings: multiple changes

2013-11-02 Thread Kevin Zheng
Committed in r19090.

To the best of my knowledge, Crossfire doesn't have a formal patch
review process. By the time everyone reviews it, bit rot will have
already set in. Best to commit it now and fix issues later if needed.

On 11/02/2013 18:24, Arvid Brodin wrote:
> * Show all keybindings (incl default ones) in both 'unbind' and the 
> keybindings
>   dialog. (Should reduce confusion for new users.)

I almost want to say that I miss the old behavior. If feasible, I'd
really like to see a "show non-default bindings only" checkbox.

Cheers,
Kevin Zheng
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire