### Author Topic: HotkeySE | DoorsCS  (Read 198 times)

0 Members and 1 Guest are viewing this topic.

#### NonstickAtom785

• LV3 Member (Next: 100)
• Posts: 62
• Rating: +4/-0
• Just live life. Cal-cu-lat-or style!
##### 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!

#### DJ Omnimaga

• Former TI programmer
• CoT Emeritus
• LV15 Omnimagician (Next: --)
• Posts: 55845
• Rating: +3151/-232
• CodeWalrus founder & retired Omnimaga founder
##### 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

#### NonstickAtom785

• LV3 Member (Next: 100)
• Posts: 62
• Rating: +4/-0
• Just live life. Cal-cu-lat-or style!
##### 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 . Doors kept that feature.
« Last Edit: Today at 12:23:30 pm by NonstickAtom785 »
Grammer2 is Good!

#### DJ Omnimaga

• Former TI programmer
• CoT Emeritus
• LV15 Omnimagician (Next: --)
• Posts: 55845
• Rating: +3151/-232
• CodeWalrus founder & retired Omnimaga founder
##### 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.
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

#### Xeda112358

• they/them
• Moderator
• LV12 Extreme Poster (Next: 5000)
• Posts: 4654
• Rating: +717/-6
• Calc-u-lator, do doo doo do do do.
##### 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).

#### NonstickAtom785

• LV3 Member (Next: 100)
• Posts: 62
• Rating: +4/-0
• Just live life. Cal-cu-lat-or style!
##### 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!

#### Xeda112358

• they/them
• Moderator
• LV12 Extreme Poster (Next: 5000)
• Posts: 4654
• Rating: +717/-6
• Calc-u-lator, do doo doo do do do.
##### 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.

#### NonstickAtom785

• LV3 Member (Next: 100)
• Posts: 62
• Rating: +4/-0
• Just live life. Cal-cu-lat-or style!
##### 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!

#### Xeda112358

• they/them
• Moderator
• LV12 Extreme Poster (Next: 5000)
• Posts: 4654
• Rating: +717/-6
• Calc-u-lator, do doo doo do do do.
##### 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)

#### NonstickAtom785

• LV3 Member (Next: 100)
• Posts: 62
• Rating: +4/-0
• Just live life. Cal-cu-lat-or style!
##### Re: HotkeySE | DoorsCS
« Reply #9 on: Today at 12:54:44 pm »
That was useful. So I made a table of all the keys and also realized that I can't use +,-,/, and * either. So I took those out of the equation. I added a section with all of the possible keys. With that I will do something like this:
Code: [Select]
If inData(GDB1,getKey)->AstrGet(Str1,startOfTable-AEnd
Grammer2 is Good!