Author Topic: pad-star and pad-divide keys have no pad prefix  (Read 367 times)

Graeme

  • Senior Community Member
  • Posts: 2246
  • Hero Points: 287
pad-star and pad-divide keys have no pad prefix
« on: October 20, 2018, 05:41:17 am »
The pad star * and pad divide / keys have an event name of just * or /.  Is that intentional or is it my keyboard?

I see slick sources looking for pad-star and pad-slash in a few places.
 

jporkkahtc

  • Senior Community Member
  • Posts: 1698
  • Hero Points: 164
  • Text
Re: pad-star and pad-divide keys have no pad prefix
« Reply #1 on: October 21, 2018, 12:08:54 am »
Works for me on Windows.
All the keys there are Pad<something>, unless numlock is on.
When numlock is on, 0-9 and . change.

Graeme

  • Senior Community Member
  • Posts: 2246
  • Hero Points: 287
Re: pad-star and pad-divide keys have no pad prefix
« Reply #2 on: October 21, 2018, 04:37:16 am »
The what-is command gives me PadStar but this code gives me * - on Windows with a Logitech K350 keyboard

Code: [Select]
_command void testkeys() name_info(',')
{
   message("Press a key, ESC to exit");
   while ( 1 ) {
      _str key = get_event('N');   // refresh screen and get a key
      _str keyt = event2name(key);
      message("keyt " keyt);
      if ( keyt == "ESC" ) {
         return;
      }
   }
}


Graeme

  • Senior Community Member
  • Posts: 2246
  • Hero Points: 287
Re: pad-star and pad-divide keys have no pad prefix
« Reply #3 on: October 21, 2018, 07:01:02 am »
If I try with a new empty config, the plus, minus and enter keys also fail to show the Pad prefix with the testkeys command.

jporkkahtc

  • Senior Community Member
  • Posts: 1698
  • Hero Points: 164
  • Text
Re: pad-star and pad-divide keys have no pad prefix
« Reply #4 on: October 21, 2018, 08:25:15 pm »
testkeys gives mostly the same result as key binding options dialog.
Except, it returns enter instead of pad-enter, 0, 1, 3, 9 and . instead of pad-key
Curiously, it returns ENTER, but with shift it is shift-pad-enter.

Your keyboard surely could be the problem.
Have you tried windows On-Screen Keyboard? It has an option to display a numpad as well.

For me, the keyboard and OSK seem to behave the same.
event2name() I guess isn't as good as whatever is done in key bindings.

Graeme

  • Senior Community Member
  • Posts: 2246
  • Hero Points: 287
Re: pad-star and pad-divide keys have no pad prefix
« Reply #5 on: October 21, 2018, 08:53:25 pm »
Thanks, I didn't know about the on-screen keyboard.  With testkeys it gives me the same results as my physical keyboard. NumPad * and / are just * and /  -  Ctrl-* and Ctrl-/ are C-PAD-STAR and C-PAD-SLASH.  I'm using slick 23.0.0.8 on Win 10.
In keybindings, if I type numpad star in the search box it shows as PAD-STAR but when I try to bind a key to it, it shows as * and says it's bound to rexx-star.  I can successfully bind a key to it by first getting PAD-STAR in the search box, then selecting the command and click the ADD button - then PAD-STAR is pre-filled.  However, I wanted to use PAD-STAR in some macro code.
The what-is command shows it as PAD-STAR.

jporkkahtc

  • Senior Community Member
  • Posts: 1698
  • Hero Points: 164
  • Text
Re: pad-star and pad-divide keys have no pad prefix
« Reply #6 on: October 21, 2018, 10:59:16 pm »
I'm also using Windows 10 and SlickEdit Pro 2018 (v23.0.0.6 64-bit)

FWIW, I've had pad-star and pad-slash assigned to macros for several years and I've never had a problem with them on several different computers, keyboards and versions of windows.
I do find it annoying when I'm using a laptop and I don't have a numpad though.

So I've been using an slightly unusual keyboard, so I pulled out an old Dell -- same results as I got before.

I found with what-are:
Pad9 with testkeys shows "9".
Pad9 with what-are: Shows pad9 but only when that is the first key I press after invoking what-are.
Other than the 1st keypress, what-are behaves like testkeys.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4587
  • Hero Points: 357
Re: pad-star and pad-divide keys have no pad prefix
« Reply #7 on: October 21, 2018, 11:39:45 pm »
The "what-is" command wraps the get_event() call with this code:

Code: [Select]
int orig_auto_map_pad_keys=_default_option(VSOPTION_AUTO_MAP_PAD_KEYS);
_default_option(VSOPTION_AUTO_MAP_PAD_KEYS,0);

k=get_event();

_default_option(VSOPTION_AUTO_MAP_PAD_KEYS,orig_auto_map_pad_keys);


Graeme

  • Senior Community Member
  • Posts: 2246
  • Hero Points: 287
Re: pad-star and pad-divide keys have no pad prefix
« Reply #8 on: October 22, 2018, 12:23:39 am »
Thanks, that fixed the problem in my code.
Do you have any idea why Joe gets different results to me?
The key bindings dialog doesn't work properly for me  - in the small window where it prompts for a key it says pad-star is just * and thinks it's bound to rexx-star.  With the what-are command, the first time it shows me PAD-STAR and if I press the key again it now shows me * and that it's bound to c-asterisk.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4587
  • Hero Points: 357
Re: pad-star and pad-divide keys have no pad prefix
« Reply #9 on: October 22, 2018, 12:29:12 am »
I can't seem to reproduce that. Not sure what's going on there. I'm testing on Ubuntu 17

Graeme

  • Senior Community Member
  • Posts: 2246
  • Hero Points: 287
Re: pad-star and pad-divide keys have no pad prefix
« Reply #10 on: October 22, 2018, 12:34:24 am »
ok, I get the same behaviour in a clean config as in my normal config.

jc44

  • Senior Community Member
  • Posts: 191
  • Hero Points: 13
Re: pad-star and pad-divide keys have no pad prefix
« Reply #11 on: October 22, 2018, 02:15:42 pm »
Just as another datapoint (Win10, UK keyboard, num-lock off) what-are reports PadStar, PadMinus, PadPlus from the number pad, all other keys lack the Pad prefix (including /).