• dd_lightbar_menu.js - hotkeys

    From Ragnarok@VERT/DOCKSUD to Nightfox on Sun Feb 9 08:31:46 2020
    Hi Nightfox,
    i working on a filebrowser using this library (you can see it in action at my board)
    i list files, then i can press enter to select files to download or esc to exit, this is fine.

    i wan to known if is possible to add another hotkey for select items. (not for each, but all)

    Example, press E over the item selected and triger "the edit file" function press D and trigger another function to delete file

    Similar to a "keypress event" on the item.
    I need to get the item and the key pressed.
    Do you think that can be possible to add?

    thanks!

    (pd: sorry my english)
    Ragnarok
    ---
    Dock Sud BBS
    https://bbs.docksud.com.ar
    ■ Synchronet ■ Dock Sud BBS TLD 24 HS - bbs.docksud.com.ar
  • From Nightfox@VERT/DIGDIST to Ragnarok on Sun Feb 9 14:47:09 2020
    Re: dd_lightbar_menu.js - hotkeys
    By: Ragnarok to Nightfox on Sun Feb 09 2020 03:31 am

    i wan to known if is possible to add another hotkey for select items. (not for each, but all)

    Example, press E over the item selected and triger "the edit file" function press D and trigger another function to delete file

    I can probably add that.

    Nightfox

    ---
    ■ Synchronet ■ Digital Distortion: digitaldistortionbbs.com
  • From Nightfox@VERT/DIGDIST to Ragnarok on Sun Feb 9 16:16:46 2020
    Re: dd_lightbar_menu.js - hotkeys
    By: Ragnarok to Nightfox on Sun Feb 09 2020 03:31 am

    i working on a filebrowser using this library (you can see it in action at my board) i list files, then i can press enter to select files to download or esc to exit, this is fine.

    i wan to known if is possible to add another hotkey for select items. (not for each, but all)

    Example, press E over the item selected and triger "the edit file" function press D and trigger another function to delete file

    Similar to a "keypress event" on the item.
    I need to get the item and the key pressed.
    Do you think that can be possible to add?

    I committed an update to dd_lightbar_menu.js to support this. You can get the latest version from CVS.

    I added a new function: AddAdditionalSelectItemKeys(), which adds additional keys that can be used to select any item (in addition to Enter). This function takes an array, and the keys are case-sensitive. For example, to add the key E to select any item (assuming the menu object is lbMenu):
    lbMenu.AddAdditionalSelectItemKeys(["E"]);
    To make a case-insensitive verison, both the uppercase and lowercase letter would need to be added, as in the following example for E:
    lbMenu.AddAdditionalSelectItemKeys(["E", "e"]);

    Also, after showing the menu & getting a value from the user (using the GetVal() function), the lastUserInput property will have the user's last keypress.

    Nightfox

    ---
    ■ Synchronet ■ Digital Distortion: digitaldistortionbbs.com
  • From Ragnarok@VERT/DOCKSUD to Nightfox on Mon Feb 10 04:15:48 2020
    El 9/2/20 a las 16:16, Nightfox escribió:
    I committed an update to dd_lightbar_menu.js to support this. You can get the latest version from CVS.


    Your are the best!
    =)


    Thanks!

    ---
    ■ Synchronet ■ Dock Sud BBS TLD 24 HS - bbs.docksud.com.ar
  • From Nightfox@VERT/DIGDIST to Ragnarok on Mon Feb 10 01:47:04 2020
    Re: Re: dd_lightbar_menu.js - hotkeys
    By: Ragnarok to Nightfox on Sun Feb 09 2020 11:15 pm

    I committed an update to dd_lightbar_menu.js to support this. You can
    get the latest version from CVS.

    Note that I've just committed another change that changes the way the function is called. AddAdditionalSelectItemKeys() now takes a string rather than an array of strings. For instance, if you want both lowercase 'e' and uppercase 'E' to work, you would call it this way (assuming lbMenu is the menu object):
    lbMenu.AddAdditionalSelectItemKeys("eE");

    Nightfox

    ---
    ■ Synchronet ■ Digital Distortion: digitaldistortionbbs.com
  • From Ragnarok@VERT/DOCKSUD to Nightfox on Tue Feb 11 05:55:04 2020
    El 10/2/20 a las 01:47, Nightfox escribió:
    Re: Re: dd_lightbar_menu.js - hotkeys
    By: Ragnarok to Nightfox on Sun Feb 09 2020 11:15 pm

    I committed an update to dd_lightbar_menu.js to support this. You can
    get the latest version from CVS.

    Note that I've just committed another change that changes the way the function is called. AddAdditionalSelectItemKeys() now takes a string rather than an array of strings. For instance, if you want both lowercase 'e' and uppercase 'E' to work, you would call it this way (assuming lbMenu is the menu object):
    lbMenu.AddAdditionalSelectItemKeys("eE");

    Nightfox

    ok! i will update!
    thanks!

    ---
    ■ Synchronet ■ Dock Sud BBS TLD 24 HS - bbs.docksud.com.ar