That’s very odd. Has this always been the case for you or is it a new problem?
Can you download the most recent nightly build and see if it is still the same?
Finally, and forgive me if this is a stupid question, but just to be absolutely sure: this is definitely the delete key you’re talking about and not the backspace key? Backspace isn’t meant to do anything, whereas del definitely should.
This is a new problem; the delete key worked before. And unless they fixed the problem within the last 12 hours or so, I don’t think another nightly build will change anything. The problem persisted when I tried a nightly build 12/8/2024, just yesterday.
The key has “Delete” printed on it, so it should be the right one.
Yeah fair enough, I know the question comes across as patronising, I just wanted to check as I know many people who don’t even know about the distinction plus on some laptops (MacBooks for example) there is no dedicated delete key but rather something like Fn + Backspace or Cmd + Backspace is used.
I’m not sure that this will solve the issue because it sounds like there is an actual bug here, but since you’re trying to delete a hydrogen atom to make a radical, just wanted to make sure you know that if you have the “Adjust Hydrogens” option turned on in the Draw Pane, Avogadro currently doesn’t delete hydrogen atoms if it would result in incorrect valencies, so I often have to turn it off to draw radicals.
For me this only stops me from deleting hydrogens with right-click though. Deleting hydrogens with the delete key always works for me, and carbon/heteroatoms are never an issue.
Does right-clicking atoms, with the Draw Tool activated and “Adjust Hydrogens” turned off, delete them?
Firstly, MacBooks in most countries (e.g. UK or Germany) match the other keyboards in those countries and don’t have words inscribed on backspace, return, and the modifier keys at all, but instead symbols, such as a leftwards arrow ⟵ for backspace.
Secondly, and this entirely supports my point – the key is labelled “delete” on a US MacBook but its placement and usual unmodified function matches what non-Mac users would call backspace. To get a “forwards delete” i.e. what most people consider the usual function of a dedicated delete key, you have to use Fn + “Delete”.
Now on my Linux system at least, Avogadro does not delete a selected atom when you press backspace, only when you press delete. I’m assuming that Qt still registers a press of a Mac’s “Delete” key as Qt::Key_Backspace and not Qt::Key_Delete (there’s no mention of different behaviour at the key enum docs) so I imagine pressing unmodified “Delete” on a Mac also doesn’t delete atoms. I can imagine that some non-Mac laptops may also do similar i.e. combine backspace and delete into a single key and use a modifier key to switch between the two functions. So someone might be under the impression that they are pressing “delete” but Qt might think otherwise, and I wanted to make sure we’re all on the same page.
Anyway that’s by-the-by since @davidshobe said this is new behaviour and it used to work.
The plot thickens: If I construct a new molecule, I can delete an atom from that. If I read in a .cjson file, I can delete an atom from that. The problem only shows up when I take an .out file and try to delete an atom. This might not be a new problem after all, since this was the first time I tried to remove an atom from an ORCA-optimized geometry.
It’s not that the .out file is read-only, since I can move an atom with the hand/manipulation tool after reading it into Avogadro, and I can delete the bond (just not the atom). EDIT: I can also replace the hydrogen with (e.g.) a lithium atom.
This is regardless of whether the number of times I have selected “adjust hydrogens” in the build menu. (Actually, I don’t see any immediate change, and “adjust hydrogens” is not replaced by “don’t adjust hydrogens” in the menu…another bug?) Incidentally, “remove all hydrogens” in the same menu does not remove any hydrogens, at least for molecules read in as .out files.
Can you upload the files concerned? What happens if you load the .out file, save as a CJSON, then restart Avogadro and load the CJSON? (Essentially what I’m interested in is whether the exact same molecular geometry behaves differently from different sources, and I imagine the .out and .cjson you’re talking about are different molecules, correct me if I’m wrong).
Toggling the option doesn’t result in an immediate change, that’s normal, and the label of the option isn’t meant to change. It’s just a checkbox for on/off.
When the option is turned on, when you click to draw a single carbon atom, four hydrogen atoms will be added to it, and if you draw ethane and then click the C–C bond to upgrade it to a double bond, two hydrogens will be removed – the valencies are automatically kept correct. This is what most people want most of the time. If the option is turned off, hydrogen atoms are not added or removed automatically. So you only see the difference between the two settings when actually drawing atoms.