Author Topic: HotkeySE | DoorsCS  (Read 191 times)

0 Members and 4 Guests are viewing this topic.

Offline NonstickAtom785

  • LV3 Member (Next: 100)
  • ***
  • Posts: 61
  • Rating: +4/-0
  • Just live life. Cal-cu-lat-or style!
    • View Profile
HotkeySE | DoorsCS
« on: September 14, 2020, 11:35:22 am »
Here's the source code to a new shell expansion I made for Doors CS. You can download it below as a file.

Can anybody tell me if I could optimize this some more? This is my first functional/released assembly program and I don't know if I've missed some optimizations. Thanks all and I hope you find this useful! The source is in the download.

Edit: I got some help from Zeda at optimizing my program as well as some from Kerm. @Roccolox helped me realize that I didn't need to check the arrow keys so now the mouse goes a lot faster because it skips the iterations when the arrow keys are pressed.
« Last Edit: Today at 11:18:42 am by NonstickAtom785 »
Grammer2 is Good!

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55845
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Hotkeys SE | DoorsCS
« Reply #1 on: September 14, 2020, 02:32:13 pm »
I didn't know that Doors CS still supported expansions. I thought that feature was only available in Doors CS 6.x or something (I remember trying an expansion that changed the GUI to something closer to MirageOS)
In case you are wondering where I went, I left Omni back in 2015 to form CodeWalrus due to various reasons explained back then, but I stopped calc dev in 2016 and am now mostly active on the CW Discord server at https://discord.gg/cuZcfcF



Official Website |T-Shirt store | Reverbnation | Facebook | Youtube | Twitter | Spotify

Offline NonstickAtom785

  • LV3 Member (Next: 100)
  • ***
  • Posts: 61
  • Rating: +4/-0
  • Just live life. Cal-cu-lat-or style!
    • View Profile
Re: HotkeySE | DoorsCS
« Reply #2 on: September 17, 2020, 03:13:04 pm »
I didn't know that Doors CS still supported expansions. I thought that feature was only available in Doors CS 6.x or something (I remember trying an expansion that changed the GUI to something closer to MirageOS)

If you got a shell expansion to do that pass it over please :P . Doors kept that feature.
« Last Edit: Today at 12:23:30 pm by NonstickAtom785 »
Grammer2 is Good!

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55845
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Hotkeys SE | DoorsCS
« Reply #3 on: September 17, 2020, 03:27:49 pm »
Unfortuntately that was about 13-15 years ago and I can no longer locate it. D:
In case you are wondering where I went, I left Omni back in 2015 to form CodeWalrus due to various reasons explained back then, but I stopped calc dev in 2016 and am now mostly active on the CW Discord server at https://discord.gg/cuZcfcF



Official Website |T-Shirt store | Reverbnation | Facebook | Youtube | Twitter | Spotify

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4654
  • Rating: +717/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Hotkeys SE | DoorsCS
« Reply #4 on: September 20, 2020, 09:32:45 am »
Alright, I just got to try this (it turns out the reason it crashed for me was a bug from another program I was testing).

This is simple and practical; good work! It genuinely improves my DCS experience just by having the [.] and [prgm] buttons for renaming and editing. (Especially the [prgm] one as that is quite intuitive, same with [(] and [)] for copy/paste).

Offline NonstickAtom785

  • LV3 Member (Next: 100)
  • ***
  • Posts: 61
  • Rating: +4/-0
  • Just live life. Cal-cu-lat-or style!
    • View Profile
Re: HotkeySE | DoorsCS
« Reply #5 on: Yesterday at 01:46:40 pm »
I was trying to make the buttons make sense when I was programming them(thanks Zeda). I'm making an extra configuration program that will change what key performs an action. I intentionally left out the delete action because I didn't want anybody or myself to accidentally delete something. But I'm going to modify it so that it won't be available until you run and configure that action to the specified key. What I need help with is getting the key name based off the key that is pressed. Any ideas as to what I should do in this scenario? (F.Y.I I'm using Axe but some native assembly code will help me a bunch too!)

I was thinking of making a zero terminated list of strings and using str-Get() to get the string based off of the key, but the only problem is how to set up the routine to do that since there are keys that cannot be used...(enter, on, graph, xton, stat, arrows, alpha, and shift)
« Last Edit: Today at 12:22:20 pm by NonstickAtom785 »
Grammer2 is Good!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4654
  • Rating: +717/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Hotkeys SE | DoorsCS
« Reply #6 on: Yesterday at 04:32:17 pm »
What you could do is have a simple menu where the user can move a cursor to highlight an option (like "Edit"), then they press a button to assign to that option. Your code looks for the string associated with the keypress, and if the string is empty (i.e., starts with a null byte), then it isn't a valid option. You also need to verify the keypress isn't already assigned to an option.

It's basically your idea, using an empty string to signify the keypress is invalid.

Offline NonstickAtom785

  • LV3 Member (Next: 100)
  • ***
  • Posts: 61
  • Rating: +4/-0
  • Just live life. Cal-cu-lat-or style!
    • View Profile
Re: HotkeySE | DoorsCS
« Reply #7 on: Today at 10:23:15 am »
What you could do is have a simple menu where the user can move a cursor to highlight an option (like "Edit"), then they press a button to assign to that option. Your code looks for the string associated with the keypress, and if the string is empty (i.e., starts with a null byte), then it isn't a valid option. You also need to verify the keypress isn't already assigned to an option.

It's basically your idea, using an empty string to signify the keypress is invalid.

I can't figure out how to make a list of zero terminated strings in axe without entering in the hex codes. Does anyone know if that's possible?
« Last Edit: Today at 12:21:45 pm by NonstickAtom785 »
Grammer2 is Good!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4654
  • Rating: +717/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: HotkeySE | DoorsCS
« Reply #8 on: Today at 12:22:36 pm »
I think you can do something like:
Code: [Select]
"HELLO"→Str1
"WORLD"[00]
"THIS"[00]
"IS"[00]
"A"[00]
"TEST"[00]

Then Str1 points to the first zero-terminated string (note that Axe will automatically tack on a 00 when you → a string)