2018-04-16 21:02:59 (edited by Rastislav Kish 2018-04-16 21:03:27)

Hi all,
someones from you probably remember Ride, my small code editor, which I released some time ago. this question relates with it, let me explayn bit more.
Programmer, which doesn't learn new things is deadh programmer. That's our lot, learning during the entire life. So I decided to learn C# few days ago.
All vent great, I quickly discovered how its command line compiler works. Now I am able to program basic things in it, my next goal is oop, what is however not important for this topic.
I browsed possibilities to bring C# to other platforms, and found Xamarin. It looked interesting, so I decided to try it out. But I found out, that instead of a standalone app, it is an extension for Visual studio.
While it would be potentially possible to manage it with cmd, I realize, that there are many things in game now, which are hard to manage from simple editors. So, it would be worth trying to move on Vs, to explore, what can I do with it.
There is however still one problem, code editing. I absolutely refuse returning back to line by line code browsing, it is something I can't imagine now. But VS can't provide me better solution, so, what to do?

Only answer which I see is to finish the plugin for NVDA, which brings the Ride functionality to any edit field.
I made a huge progress some time ago when I managed to implement the movement mechanism. It surprised me a lot, when I take in fact, that I didn't and still don't know anything about NVDA plugins, all I did was taking the code of Indentnav plugin by Tony Malykh and erasing the functional part, replacing it with my own algorithms from Ride.
There are however few things, I can't do. One from them is change of gestures in runtime.

I have understood, that there is an dictionary called __gestures, which contains list of keystrokes with assigned methods to proceed in case they're pressed. Here I have defined all shortcuts like down arrow, up arrow, alt+left arrow, alt+right arrow etc, and it works.
But you can probably imagine, what it does with navigation in os surface. It is totally broken of course. So I need to change these shortcuts, or better said deactivate them for example on ctrl+k shortcut. When user press ctrl+k, and Ride is deactivated, it turns on all the shortcuts. If user press ctrl+k again, Ride will deactivate shortcuts, and navigation is free again.
Can someone help me, how to do this? I read something about gestures binding, but that document is probably out of date, because I haven't found referred methods in current release of NVDA.

Thanks you in advance

Best regards

Rastislav

2018-04-16 21:34:23

I'm honestly not sure why you don't like the VS editor as is. You've got all the functionality you could ever ask for (and more). Hell, ever since .NET 4.6.x's VS editor update the VS editor now uses the C# compiler platform, Roslyn, as a code analyzer and syntax parser as you type. Granted, code folding doesn't work very well, but still, I honestly don't understand your dislike of the editor itself. Integrating Ride's functionality into all edit fields would most likely cause major problems with NVDA, because not all edit fields support code folding, and most edit fields don't need the features Ride uses. Honestly, if I were you, I'd get used to the VS code editor -- if your going to write .NET apps your going to be using it quite a bit. You may not like it, but keep in mind you have find, you have find/replace, refactoring, and more; things you really could never implement yourself without foreknowledge of the entire editor system, intelli sense, and Roslyn. (You also most likely couldn't integrate Roslyn into BGT, or whatever Ride is written in, unless its written in .NET.) However, I can't answer your question because I don't write NVDA plugins tongue. Also... fro cross-platform .NET apps, don't forget .NET Core.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2018-04-17 02:53:59

Have a look at bindGestures

Usage is to have multiple dictionaries. One for enabling the add-on, control+K in your case, and that would point to a main function.

In this function, you would use self.bindGestures(self.__otherdict)

__otherdict would be in the same format as __gestures. Just make sure to bind __gestures again, bad things could happen otherwise

2018-04-17 16:52:48

What's so wrong with visual studio editor, why you need this code folding, all it does is get in the way, whenever someone collapses stuff in their code if its open source, and I import it, the first thing I do is expand all. The visual studio compiler is very good, surprisingly helpful in fac when you screw up, a lot of times it will give you hints of what could be wrong. And then you have the amazingness that is Intellisense. What more could you ask for?

For your NVDA related question, why not post it on the NVDA dev list.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2018-04-17 19:02:37

Post 4 gives out some very useful tips. Not just that but the fact that when you get a compiler error (I've gotten lots of those, we all have), said error usually has a show help link next to it, or you can press F1 on it, and you can immediately be brought to the documentation for that error. I.e. If you get CS0029 (Cannot implicitly convert type 'type' to 'type') and you press F1 on that error, you get brought to https://docs.microsoft.com/en-us/dotnet … es/cs0029. I don't see why you'd ever have a problem with the editor; most problems you'd face are either problems you've generated yourself, or problems that are most likely easily fixable by toggling an option or two somewhere.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2018-04-19 05:30:20

Well first of all, VS give to you a lot of shorcut to increase the speed of your navigation in code.

In the solution explorer (alt+ctrl+l) when you're over a code file, you can expand it's content with the arrow, and navigate through it's properties, methods and classes, and after that pressing enter you can point directly the editor to that piece of code.
Next in code, you can use other shortcuts to fast moving to the closer opening / closed scope, etc. And if you want more things, well. you can program (or find in vs marketplase) and extension that add a lot of other things like that. Really man, you're reinventing the wheel, and that is one of the worst things that you can do in programing.

Well, outside of that scope, about your question directly, if you don't want play directly with the bindings of nvda dictionaries as @cartertemm said, you can add to your plugin a direct system keyboard hook that detect the keys that you need for doing things in the plugin, and with a nvda gesture, you can tell to the plugin turn on / off the hook.

Of course isn't a elegant solution, but can works, and fine.

With ctypes or CFFI, you can use without many tricks the global system keyhooks of win32lib.

But again. Vs give to you many, and a lot of Mani coding tools for refactoring, searching, encapsulating and much and much more for do things like your plugin does with a full compatibility with the ide.

But well, for other side, is a good challenge build tools like that, only for probe yourself that you're capable of do powerful things like that.

Good luck.

ps: look at reSharper extension that add a lot of features for refactoring and fast coding.

2018-04-19 17:50:30

Hi all,
@Cartertem thanks very much, that was exactly what I was looking for. smile
I found also clearGestures method, which will clear previously set gestures, so it is working now.
I am just curious, is there a way, how to change content of the textInfo made from an text field? I am interested about it, because it is one from possible solutions to another problems, but I think I will be able to solve it differently, even if it's not possible.

About vs, well, guys, I think we still haven't understood ourselves. I don't argue that Vs is good. I know its features, they are very useful in right time.
Ride is not project trying to override these features. If it wants to do so, I won't be interested in making plugin for nvda, I have my own editor already.
Ride was always there to propose a new way of working with code for blind programmers. Because it is a huge difference how sighted and non-sighted programmers are processing informations. If blind programmer wants to find something in the code, he must to read every line until he get there. I don't mean methods or classes now, but also internal program structures like cycles or conditions and theyr subconditions + bodies.
if sighted programmer have just one line of code displaied on the screen and must navigate by arrow keys only, he will get crazy after few minutes. Sighted are scanning through code, not reading, that is a monumental difference. Power is in simplicity, no jumping to the trees, searching, pressing enter, changing something, again jumping, they just see everything and are able to scan through it in second.
That is the reason, why sighted programmer is able to familiarize with unknown code much faster than blindone, that is the reason why he can make edits more faster. If he is writing a program and realizes, that one cycle, which he made few minutes ago is wrote incorrectly, all he needs to do is one click on it and shortcut for discard. Vs was built for this, not for our screenreaders. Although there is a great compatibility now, these features, which are used most of all are not accessible, because noone thought out a system, how to bring them for visually impaired.
Noone until now. Here is a power of Ride, because it provides similar speed of code editing like sighted have, and I don't mean tools like is, but that most frequently used system of sighted, which is called eyes.
That is of course my opinion. If you were blind from your birth, then we probably have completely different system of imagining things, and along with it completely different requirements.
So, the decision factor will be the skill, everyone can try out, if Ride is giving him something. if yes, like it is in my case, then he/she may be interested in this topic, because I want to provide all tools of Visualstudio like is or other hint systems along with Ride navigation, so he/she can work in the most popular ide on Windows, last features and the most accessible code editing, if he/she feels Ride in this way.
In the other case this will give him no plusses, like invention of 3d pen is absolutely useless for me, because I am not interested in scorching my fingers by plastic. big_smile

Best regards

Rastislav

2018-04-19 19:59:57

Rastislav Kiss, a bit of counterargument:
First, you say that a blind programmer has to read every single line of code to find what they're looking for. This is both incorrect and very boring, and shows laziness on your part for refusing to exploit the full powers of the editors and tools you have at your disposal. A blind programmer does not necessarily process information differently than a sited programmer does when it comes to programming; some blind programmers even pay attention to indentation (especially in languages that enforce it). You ever heard of this thing called find/replace? How about GNU grep? Both of these tools are excellent for searching for what I'm looking for; find is good for when I'm in a source file and want to edit it in multiple places without line numbers, and grep is good for, well a lot of things.
Also, VS may be built for sited but it also has accessibility functions. A blind programmer can be as productive as a sited person is using visual studio if they take their time, determine their own way around it, and are willing to learn.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2018-04-19 20:36:05

Yeah I agree, @op, you're trying to create a  solution for which the problem does not exist.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2018-04-19 22:14:56

Hell, even 10 years ago with VS 2008, 2005, 2003... every version of visual studio has been accessible in one way or another. This "solution" would've never been, or will it be, necessary. Your only overcomplicating matters and making your life more difficult for yourself.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2018-04-20 05:27:19

Well @Rastislav Kiss I want to give to you a chance.
Do you have a released (or pre-releace) version of ride to test it?

I want to try it, to check is useful for mi style of programming. specially that currently on my work, I have to see fastly new code for other co-workers and make edits, and of course understand it. Or in most important cases, understand all the code to make a new and fresh refactoring of them.

Hmm currently rides supports c#? or javascript?

Or only bgt.

Thanks for all :3

2018-04-23 17:14:11

Hi guys,
especially at Ethin's post,: well, if we didn't discuss few other problems on this forum, i would never say you're a programmer.
Seriously, even notepad have search functions. They are useful when you need to jump for example to a known method, some big structure, which have its typical name you can remember and typical notation, which can be found easily without mistakes.
But what about smaller structures? Imagine you have 6 cycles in a complicated hierarchy, with lots of conditions and lots of calculations with cycles variables. How do you use search functionality here?
Yeah, you can use comments as marks, but then you a. must remember all their names along with locations, b. will spend much time with creating unique names and fixing positions, when you work on big modifications of code.
That is something not acceptable, minimally for me, I consider structure of the program more important, because it shows very clearly and detailed how it works, also when there are very complicated code structures.
That is functionality of the Ride. It can't be compared with some search functions, it have nothing to do with them.
I can't explayn it better, if this doesn't help in understanding, then I give up, problem will be probably in my english or somewhere near it.

@Sanslash332: There was a thread about Ride, check:
https://forum.audiogames.net/viewtopic. … 59&p=2
if you are interested. If you decide to try it, I recommend you to read documentation first. Some users were shocked after launching Ride, when it didn't read some important characters to them, and have thrown it away immediately. That is however a planned behaviour, because every screenreader is processing strings sent to speak differently, ride does nothing with text upon your request, there are methods to configure it, so reading will be correct.
About supported languages, well, there aren't any, Ride is fully universal. It isn't a code analysis tool, as some guys mistakenly understood it, but rather a navigator, which wants to show you code from a different perspective, clearer and more accessible for blind programmer.
I personally use it on C++, C#, Java, Kotlin and Python, so it really matters your choice, you can assign it with extensions of these languages, so files will open in it automatically, or the Ride option will appear in context menu, when you are on file with extension you previously set.

Greetings

Rastislav

2018-04-23 22:10:21 (edited by Ethin 2018-04-23 22:13:13)

@12, no, I do not see what your problem is. I have navigated complicated program structures in visual studio and have navigated small ones. And I never had any programs, plugins, or other things assisting me other than NVDA and the features of visual studio. Either you are lazy, and refuse to learn the features of visual studio, or refuse to look up how to do things within visual studio; or you know how to solve the problem your trying to solve without any add-ons or plugins, but you are too lazy to use them. Or I may be wrong. But I still don't see your problem.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2018-04-25 04:03:06

@Rastislav Kiss giving to ride a try :3

Respecting to the big structures... well guy, if you fall in to a case when you have a 6 cycles of conditions and loop one into other, you are really in a big problem ordering your code. That case is a emergency time for do some refactoring to your code.

The best method to have a ordered code is try to put the smallest and atomic functions in diferent methods, that are called by the organizers and launchers for order the small task in a more big algoritm.

With that you can jump between different portion of code with the traditional "go to definition" without more complexity tongue

But as im saying at the start of the post, downloading and giving a chanse to the ride tongue

2018-04-25 21:17:10

Hi,
yes, I am lazy, verry lazy. big_smile
However not in getting familiar with  ide functionality or research, but in making non-sensical things. smile
Why would I make millions of methods, remember their names and constantly jump between them, when I can have everything on the one place, well commented and organized, even if there are such 6 cycles?
Yes, this is relatively rare, but there are much more situations, which can be good example of it, like switches, or even better conditions, where more factors take their place, and there is a much code in their code blocks. Yeah, it can be separated in a method, but I am lazy to make jumps constantly, when I can organize it all from one place.

I don't say it is impossible to manage code in standard way. Many of my projects before Ride's release I wrote normally, with or without ide. I tried various things like Delphi, Eclipse, Visual studio, Notepad++ or classical notepad, handling all manually.
So it is possible, but Ride is clearer and faster. tongue

Best regards

Rastislav

2018-04-25 23:37:17 (edited by Ethin 2018-04-25 23:37:45)

@Rastislav Kiss, code how you want. But putting all your program logic and stuff like that in one single method makes for a very, very difficult to manage program (not to mention all the difficulties you'd run into during program execution). It works for small programs, but for large ones...

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github